Our application take a very long time to compile. Any change to the Dockerfile triggers a full-recomplile (which takes a very long time) The Dockerfile is a muli-stage build. I'm trying to work on the second stage. Is there any way to tell docker build to begin at the second stage?
FROM debian:latest AS builder
# 10-20 mins worth of stuff here
FROM alpine:latest AS runner
WORKDIR /
COPY --from=builder /work/myapp.zip .
RUN unzip myapp.zip -d /myapp
# and more stuff that I'm working on here
Is there some way to do docker build --begin-with runner?
You can use --target [STAGE-NAME] from the build command according to the documentation, e.g
docker build -f Dockerfile --target runner -t imagename:1.0 .
This will compile just the runner stage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With