-
-
Notifications
You must be signed in to change notification settings - Fork 934
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
Add NO_CACHE to build.sh #1404
base: develop
Are you sure you want to change the base?
Add NO_CACHE to build.sh #1404
Conversation
Add the ability to disable Docker build cache
Could you explain or do you have an example when that's the case? |
I can probably provide screenshots of this if needed, but the build process sometimes skips past the container rebuild if you are doing in quick succession as it caches the results of the build |
I'm doing a lot of Docker builds and I never had this problem. So that's why I'm curious. Docker is extremely good at caching and cache invalidation. If the input doesn't change, then the output won't change. I therefore suspect a situation, where something goes wrong with the inputs. This could be due to one of the following reasons, and possibly more:
I'd like to find out if it's either of the first two. Then we have a problem in our build that we need to solve. Otherwise, it's probably an oversight in your Dockerfile. Since the build script is used in CI/CD mostly, and since caching improves the build speed, I'd like to be sure that there's no problem with caching. Therefore, please bring forward an example where the build does not work as expected, so that we can investigate. |
Hi, Another case where this has gotten in the way is if a package has been recently updated on PyPI. I have wanted to test new plugin updates a few hours after release but the cache just skips past the stage where it pulls the packages. I'll try and work on some other examples that I have encountered |
This should usually not be a problem. The currently best practice here is to specify the exact version of the plugin when building the container, because it's the only way to ensure that you get the same result everytime. So, when you update the version in the input file, then Docker will invalidate the cache. |
The downside is that this flag, once in, must be carried over and tested whenever we change the build process in the future. So if we can get away with not having the functionality, we'd rather not have it. |
Yeah that's understandable although I can't see how having the option to disable the cache will impact the build functionality |
It doesn't right now. But it will increase the maintenance down the road. E.g. when supporting another build system one day, like Podman. So if this flag is not absolutely needed, then we'd rather not have it. |
Add the ability to disable Docker build cache
New Behavior
Add the ability to disable the Docker build cache
Contrast to Current Behavior
If source code is changed, sometimes it is difficult to rebuild Docker images.
Discussion: Benefits and Drawbacks
Makes building custom images easier
Changes to the Wiki
None required
Proposed Release Note Entry
Adds the ability to disable Docker build cache
Double Check
develop
branch.