Created
September 18, 2022 13:13
-
-
Save rahul-yr/c250d3f9b16d23b0ae48e38d95915aff to your computer and use it in GitHub Desktop.
Docker Golang light weight image Dockerfile
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
FROM golang:1.19.1-alpine3.16 as builder | |
WORKDIR /app | |
COPY go.* ./ | |
RUN go mod download | |
COPY . ./ | |
RUN go build -v -o server | |
FROM alpine:3.16 | |
COPY --from=builder /app/server /app/server | |
EXPOSE 8080 | |
CMD ["/app/server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment