I am analysing some slightly strange behaviour in our automated build processes, which lead me to ask:
Does hub.docker.com use the --no-cache
option when performing automated builds?
Docker Hub provides the following major features: Repositories: Push and pull container images. Teams & Organizations: Manage access to private repositories of container images. Docker Official Images: Pull and use high-quality container images provided by Docker.
The concept of Docker images comes with immutable layers. Every command you execute results in a new layer that contains the changes compared to the previous layer. All previously built layers are cached and can be reused.
If you're using Docker Compose, you can add the cache_from option to the compose file, which maps back to the docker build --cache-from <image> command when you run docker-compose build . To take advantage of BuildKit, make sure you're using a version of Docker Compose >= 1.25. 0.
Docker Hub can automatically build images from source code in an external repository and automatically push the built image to your Docker repositories. When you set up automated builds (also called autobuilds), you create a list of branches and tags that you want to build into Docker images.
Unfortunately, this was not the case for me. I had to end up rebuilding the image with the --no-cache flag. Then push the image up to docker hub. Admittedly the dockerfile used was not with best practice as it involved a "git pull". Oh well!
Yes. The build process is currently:
git clone --recursive --depth 1 -b branch $URL
Readme
and Dockerfile
docker build -t tagname --nocache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With