Created
May 13, 2022 22:58
-
-
Save inductor/ca000a2437dce74b95ffc716bf0268ea to your computer and use it in GitHub Desktop.
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
# syntax=docker/dockerfile:1.4 | |
FROM golang:1.17-bullseye as build | |
WORKDIR /go/src/app | |
RUN <<EOF | |
apt-get update | |
apt-get install -y git | |
apt-get clean \ | |
rm -rf /var/lib/apt/lists/* | |
EOF | |
RUN --mount=type=ssh git clone [email protected]:myorg/myproject.git myproject | |
RUN go mod download | |
RUN go build -o /go/bin/app | |
# ビルドステージからコピー | |
FROM gcr.io/distroless/base-debian11 | |
COPY --from=build /go/bin/app / | |
CMD ["/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment