Skip to content

Commit

Permalink
use dep to resolve dependencies and cache the vendor libs
Browse files Browse the repository at this point in the history
  • Loading branch information
serbrech committed Dec 5, 2017
1 parent e428154 commit 2a8a66d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# build stage
FROM ataraev/golang-alpine-git AS build-env
ADD . /go/app
WORKDIR /go/app
ENV GOBIN /go/bin
RUN go get -d -v ./
RUN apk add --update openssl && \
wget -O /go/bin/dep http://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 && \
chmod +x /go/bin/dep

COPY ./Gopkg.* /go/src/github.com/lawrencegripper/traefik-appinsights-watchdog/
WORKDIR /go/src/github.com/lawrencegripper/traefik-appinsights-watchdog
RUN dep ensure --vendor-only -v

COPY . /go/src/github.com/lawrencegripper/traefik-appinsights-watchdog/
RUN go build -o traefik-appinsights-watchdog -v

# final stage
FROM golang:alpine
WORKDIR /app
COPY --from=build-env /go/app/traefik-appinsights-watchdog .
COPY --from=build-env /go/src/github.com/lawrencegripper/traefik-appinsights-watchdog/traefik-appinsights-watchdog .
ENTRYPOINT ["./traefik-appinsights-watchdog"]

0 comments on commit 2a8a66d

Please sign in to comment.