You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a multistage docker build with 2 images: a builder image and a production image. The builder image contains additional things that I don't need in production. I am only using it to do some groundwork and copy the results to the production image. Pretty much the default scenario builder images are used for. My dockerfile is functional, it is being used in production for years. I am migrating its building to Github Actions.
I am seeing that the production image step that copies things from the builder image is being executed while the builder image is still being built. Notice below the first line vs the last two lines.
I would expect that the builder image is built first, and only then would the steps from the production image using it should appear.
Actual behaviour
I am seeing that the production image step that copies things from the builder image is being executed while the builder image is still being built.
Configuration
FROM gcr.io/staging-artifacts-... as BuilderENV ...# OS dependenciesUSER rootRUN apk add --update --no-cache \...WORKDIR $APP_HOME# Only copy the Gemfiles without any other source code so that we can install the gemsCOPY Gemfile $APP_HOME/GemfileCOPY Gemfile.lock $APP_HOME/Gemfile.lock# Bundle installRUN gem install bundler:2.4.10 && \...################################ Stage Final###############################FROM gcr.io/staging-artifacts-... as ProductionENV ...USER rootRUN ...# copy app with gems from former build stageCOPY --from=Builder /usr/local/bundle/ /usr/local/bundle/WORKDIR $APP_HOME# copy the app's source codeCOPY --chown=my_project . $APP_HOME# copy the gems from the builder imageCOPY --from=Builder --chown=my_project $APP_HOME/vendor/bundle/ $APP_HOME/vendor/bundle/USER my_project
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Behaviour
I have a multistage docker build with 2 images: a builder image and a production image. The builder image contains additional things that I don't need in production. I am only using it to do some groundwork and copy the results to the production image. Pretty much the default scenario builder images are used for. My dockerfile is functional, it is being used in production for years. I am migrating its building to Github Actions.
I am seeing that the production image step that copies things from the builder image is being executed while the builder image is still being built. Notice below the first line vs the last two lines.
Expected behaviour
I would expect that the builder image is built first, and only then would the steps from the production image using it should appear.
Actual behaviour
I am seeing that the production image step that copies things from the builder image is being executed while the builder image is still being built.
Configuration
Beta Was this translation helpful? Give feedback.
All reactions