Skip to content

Commit

Permalink
making Docker file multi-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravi Yasakeerthi committed Nov 4, 2021
1 parent e1c47c4 commit 8354e99
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
FROM golang:alpine
FROM golang:alpine as builder
ENV GO111MODULE=on
WORKDIR /app
ADD ./ /app
WORKDIR /builder
ADD ./ /build
RUN apk update --no-cache
RUN apk add git
RUN go build -o golang-test .


FROM alpine:3.14
WORKDIR /app
COPY --from=builder /build/golang-test .
EXPOSE 8000
ENTRYPOINT ["/app/golang-test"]
EXPOSE 8000

0 comments on commit 8354e99

Please sign in to comment.