Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does hub.docker.com use "--no-cache" for automated builds?

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?

like image 692
tbsalling Avatar asked Sep 23 '14 13:09

tbsalling


People also ask

What are the main features of Docker hub?

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.

What is build cache in 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.

Does Docker compose have cache?

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.

Is docker a build automation tool?

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.


2 Answers

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!

like image 107
djsd123 Avatar answered Sep 23 '22 11:09

djsd123


Yes. The build process is currently:

  1. git clone --recursive --depth 1 -b branch $URL
  2. Extract Readme and Dockerfile
  3. docker build -t tagname --nocache
  4. Tar and upload the build context to S3 bucket
  5. Push image (with all layers) to Registry
  6. Worker or Builder cleans up build residue (mounted volumes, etc)
like image 21
Andy Avatar answered Sep 20 '22 11:09

Andy