Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cert copy from Dockerfile #80

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@ COPY . ./
# -mod=readonly ensures immutable go.mod and go.sum in container builds.
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server

# Use the official Alpine image to install certificates.
# https://hub.docker.com/_/alpine
FROM alpine:3 AS certs
RUN apk add --no-cache ca-certificates

# Build the runtime container image from scratch, copying what is needed from the two previous stages.
# Build the runtime container image from scratch, copying what is needed from the previous stage.
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM scratch
# Copy the binary to the production image from the builder stage.
COPY --from=builder /app/server /server
COPY index.html ./index.html
COPY assets/ ./assets/
# Copy the root certificates from the certs stage
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Run the web service on container startup.
ENTRYPOINT ["/server"]