-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from willejs/docker-image
Change to multi stage build dockerfile
- Loading branch information
Showing
1 changed file
with
13 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,21 +1,28 @@ | ||
FROM golang:1.9-alpine | ||
|
||
ENV PORT_NUM 9200 | ||
WORKDIR /go/src/github.com/abutaha/aws-es-proxy | ||
COPY . . | ||
|
||
#RUN go-wrapper download | ||
#RUN go-wrapper install | ||
|
||
RUN apk add --update bash curl git && \ | ||
rm /var/cache/apk/* | ||
|
||
RUN mkdir -p $$GOPATH/bin && \ | ||
curl https://glide.sh/get | sh | ||
|
||
RUN glide install | ||
RUN go build -o aws-es-proxy | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o aws-es-proxy | ||
|
||
|
||
FROM alpine:3.7 | ||
LABEL name="aws-es-proxy" \ | ||
version="latest" | ||
|
||
RUN apk --no-cache add ca-certificates | ||
WORKDIR /home/ | ||
COPY --from=0 /go/src/github.com/abutaha/aws-es-proxy/aws-es-proxy /usr/local/bin/ | ||
|
||
ENV PORT_NUM 9200 | ||
EXPOSE ${PORT_NUM} | ||
|
||
CMD ["./aws-es-proxy", "-h"] | ||
ENTRYPOINT ["aws-es-proxy"] | ||
CMD ["-h"] |