Skip to content

Commit

Permalink
Merge pull request #25 from willejs/docker-image
Browse files Browse the repository at this point in the history
Change to multi stage build dockerfile
  • Loading branch information
abutaha authored Mar 31, 2018
2 parents 01e8be4 + a52111e commit a67b8e8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Dockerfile
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"]

0 comments on commit a67b8e8

Please sign in to comment.