dazzling-petabyte-91122
05/04/2022, 7:40 PMFROM golang:alpine as builder
WORKDIR /app
RUN apk update && apk upgrade && apk add --no-cache ca-certificates
RUN update-ca-certificates
ADD . /app/
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o my-app .
FROM scratch
COPY --from=builder /app/my-app .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["./my-app"]
However when using the docker integration, it fails saying that my-app
and ca-certificates
aren't in the Docker build context. Is there a way to copy files using --from
with a multi stage build?