Skip to content

Commit

Permalink
Merge pull request #13 from planetary-social/enable-cgo
Browse files Browse the repository at this point in the history
make sure app image also has glibc
  • Loading branch information
cooldracula authored Oct 18, 2023
2 parents 8e91429 + 5a44dbb commit 1534022
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ WORKDIR /usr/src/app
COPY . .
# get ssl certs to copy into scratch image, as it won't have them by default.
RUN apt update && apt-get install git ca-certificates && update-ca-certificates
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -o /usr/local/bin/crossposting-service ./cmd/crossposting-service
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -o /crossposting-service ./cmd/crossposting-service


FROM scratch as app
FROM gcr.io/distroless/cc-debian12
WORKDIR /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /usr/local/bin/crossposting-service /crossposting-service
COPY --from=build /crossposting-service /crossposting-service
CMD ["/crossposting-service"]

0 comments on commit 1534022

Please sign in to comment.