-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: Use go get to fetch dependencies
- Use proper GOPATH to avoid recurring dependencies
- Loading branch information
1 parent
c181654
commit faad296
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
FROM golang:alpine as build-env | ||
LABEL MAINTAINER Naveen Kumar Sangi <naveenkumarsangi@protonmail.com> | ||
|
||
RUN apk --no-cache add curl git | ||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
ENV SOURCE /go/src/app | ||
RUN apk --no-cache add git | ||
ENV SOURCE /go/src/gitlab.com/nkprince007/listen | ||
RUN mkdir -p $SOURCE | ||
ADD . $SOURCE | ||
WORKDIR $SOURCE | ||
RUN dep ensure -v | ||
RUN go get -v ./... | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
|
||
|
||
FROM alpine:latest | ||
|
||
RUN apk --no-cache add ca-certificates | ||
ENV SOURCE /go/src/gitlab.com/nkprince007/listen | ||
WORKDIR /root/ | ||
COPY --from=build-env /go/src/app . | ||
COPY --from=build-env $SOURCE . | ||
CMD ["./app"] |