https://pantsbuild.org/ logo
#general
Title
# general
d

dazzling-petabyte-91122

05/04/2022, 7:40 PM
hey everyone! So I have a quick question. I could be looking at this the wrong way, but we have a multi stage Dockerfile. It follows this layout:
Copy code
FROM 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?