Skip to content

Commit

Permalink
multistage docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ugzuzg committed Apr 26, 2018
1 parent c50614d commit 4af4cab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
goaws
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
FROM golang:alpine as builder

WORKDIR /go/src/github.com/p4tin/goaws

RUN apk add --update --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ dep git

COPY Gopkg.lock Gopkg.toml app ./
RUN dep ensure
COPY . .

RUN go build -o goaws_linux_amd64 app/cmd/goaws.go

FROM alpine

EXPOSE 4100

COPY ./goaws_linux_amd64 /
COPY --from=builder /go/src/github.com/p4tin/goaws/goaws_linux_amd64 /
COPY ./app/conf/goaws.yaml /conf/
ENTRYPOINT ["/goaws_linux_amd64"]

0 comments on commit 4af4cab

Please sign in to comment.