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
Split docker image into multiple stages and improve cache behavior (#24447)
This PR does a major and a minor thing:
* __Major__: splits the dockerfile into multiple stages: a 'common'
stage which represents the build-and-run environment of the final image,
a 'build' environment which contains all the sources etc. necessary to
build Chapel, and a 'release' environment which contains the final build
products etc. The multi-stage nature of the build allows files that we
don't care about (the `.git` directory, the LLVM sources, most of the
`test` directory) to be skipped when building the final image. This way,
we are able to strip off at least 0.6GB from the image, and that's not
including the size of `.git` (not included in my experiments).
* __Minor__: Adds a `.dockerignore` file that ignores the `Dockerfile`.
This way, the `COPY . .` has less of a chance to invalidate the cache as
you are iterating on the docker image by tweaking the Dockerfile.
Reviewed by @riftEmber -- thanks!
## Testing
- [x] Image build succeeded
- [x] Successfully used image in a devcontainer
0 commit comments