-
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.
making Docker file multi-stage build
- Loading branch information
Ravi Yasakeerthi
committed
Nov 4, 2021
1 parent
e1c47c4
commit 8354e99
Showing
1 changed file
with
9 additions
and
4 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,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 |