Skip to content

Prevent Pipeline from rebuilding shared parent stage in multi-stage build #3599

Answered by dannyrandall
DrewVartanian asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @DrewVartanian! Using ARG in docker build makes it so future instructions are not cached. Some details around that are available here.

One potential solution you could try is moving the ARG command into the web and worker stages like this:

FROM base AS web
ARG name

FROM base AS worker
ARG name

This way, the base stage layers will be cache-able and should only run once in your pipeline. Let me know if this works for you!:blush:

EDIT

Another potential solution: #3510 (comment)

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by DrewVartanian
Comment options

You must be logged in to vote
6 replies
@DrewVartanian
Comment options

@dannyrandall
Comment options

@dannyrandall
Comment options

@DrewVartanian
Comment options

@dannyrandall
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants