Created
June 2, 2022 16:50
-
-
Save AlperRehaYAZGAN/12ab04b36540b4d87f22d7f5c3005b2a to your computer and use it in GitHub Desktop.
Simple multistage golang executable only build Dockerfile
This file contains hidden or 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
# first stage | |
FROM golang:1.17-alpine3.15 AS build-env | |
RUN apk add build-base | |
ADD . /src | |
RUN cd /src && go build -o goapp | |
# second stage | |
FROM alpine | |
WORKDIR /app | |
COPY --from=build-env /src/goapp /app/ | |
EXPOSE 9090 | |
ENTRYPOINT ./goapp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment