-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track injected files when caching Docker builds #273
Comments
Pro: Works around an issue with the way Cirrus caches containers: cirruslabs/cirrus-ci-docs#273 Con: - Requires regenerating/recommiting Dockerfiles whenever requirements change. - This will break if the character `'` is used in requirements*.txt
Yeah. I've though about it and that might be a bit tricky. The solution I came up comes to the following new flow: when a Dockerfile contains |
Created cirruslabs/cirrus-cli#222 to track implementation of this feature. |
BTW there is a potential danger or using |
Implemented in cirruslabs/cirrus-cli#452. |
Thanks a bunch! I look forward to using that, and/or the new Skylark support, to speed up our CI dramatically. Back when I tested this, I could get Linux & Windows CI times below 5s w/ prebuilt containers, and the issue was that we had no good way to make it work properly when dependencies changed (either updates in PyPI, or changes in the requirements files) |
@nbraud under 5 seconds!? Wow! Would love to see your confit if it will be public. 💪 |
Description
Currently, Docker image builds are cached based on (a hash of) the
Dockerfile
's contents.By opposition, Docker's canonical cache recognise
ADD
instructions, and will only reuse a built layer if the same file is being added.Please consider aligning the behaviour with Docker's.
This can be done by tracking
ADD
ed files and directory during the build, hashing them, and making that manifest part of the hash that identifies a specific build.Context
When using Dockerfiles as CI environments, it is common to inject files that describe dependencies (Python's requirements files, Maven project files, ...) and preinstall all necessary dependencies.
With the current behaviour, Cirrus doesn't invalidate the cached build, resulting in CI environments that do not have the correct dependencies installed.
The text was updated successfully, but these errors were encountered: