Created
March 11, 2024 22:37
-
-
Save rspier/693f0a39f5ed2210a6b450a238328335 to your computer and use it in GitHub Desktop.
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:alpine as BUILDER | |
RUN apk update && apk add --no-cache git | |
WORKDIR /src | |
# << bake dependencies into builder image | |
COPY go.mod . | |
COPY go.sum . | |
RUN go mod download | |
# >> | |
# bring source into image | |
COPY . . | |
# build | |
RUN CGO_ENABLED=0 go build -o /go/bin/imap-pusher github.com/rspier/random/imap-pusher | |
RUN touch /.empty | |
FROM scratch | |
WORKDIR / | |
COPY --from=builder /go/bin/imap-pusher /imap-pusher | |
# If we don't put something in the /tmp/ directory, it doesn't exist, | |
# since this is FROM scratch. | |
COPY --from=builder /.empty /tmp/.empty | |
COPY --from=builder /etc/ssl /etc/ssl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment