-
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 dep to download dependencies See merge request nkprince007/listen!1
- Loading branch information
Showing
2 changed files
with
10 additions
and
6 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,4 +1,3 @@ | ||
vendor | ||
Gopkg.lock | ||
Gopkg.toml | ||
.git | ||
listen |
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,13 +1,18 @@ | ||
FROM golang:onbuild | ||
FROM golang:alpine as build-env | ||
LABEL MAINTAINER Naveen Kumar Sangi <naveenkumarsangi@protonmail.com> | ||
ENV SOURCE /go/src/gitlab.com/nkprince007/listen/ | ||
|
||
RUN apk --no-cache add curl git | ||
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
ENV SOURCE /go/src/app | ||
ADD . $SOURCE | ||
RUN go get -u -v . | ||
WORKDIR $SOURCE | ||
RUN dep ensure -v | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
|
||
|
||
FROM alpine:latest | ||
|
||
RUN apk --no-cache add ca-certificates | ||
WORKDIR /root/ | ||
COPY --from=0 /go/src/gitlab.com/nkprince007/listen/app . | ||
COPY --from=build-env /go/src/app . | ||
CMD ["./app"] |