Support for using a local Docker cache for base images
See original GitHub issueDescription of the issue:
Expected behavior:
Steps to reproduce:
Environment:
jib-maven-plugin
Configuration:
PASTE YOUR pom.xml CONFIGURATION HERE
jib-gradle-plugin
Configuration:
PASTE YOUR build.gradle CONFIGURATION HERE
Log output:
Additional Information:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Registry as a pull through cache - Docker Documentation
The Registry can be configured as a pull through cache. In this mode a Registry responds to all normal docker pull requests but...
Read more >How Does the Docker Cache Work? - vsupalov.com
We can fill the local Docker cache up from a remote source - for example when pulling image layers from a public or...
Read more >Docker Cache – How to Do a Clean Image Rebuild and Clear ...
Docker Build Cache ... Building images should be fast, efficient, and reliable. The concept of Docker images comes with immutable layers. Every ...
Read more >Enabling Docker Layer Caching - CircleCI
Docker layer caching (DLC) is a great feature to use if building Docker images is a regular part of your CI/CD process. DLC...
Read more >Pulling cached Docker Hub images - Google Cloud
Container Registry caches frequently-accessed public Docker Hub images on mirror.gcr.io . You can configure the Docker daemon to use a cached public image...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@menya84 @NathanHowell @furyu-john @ehirsch @seanabraham @tedgine-ml @tellisnz-shift @sepe81 @mzagar @infa-rbliznet @tdanylchuk @freedev @xRomZak @Liu233w @PierreBesson @lostiniceland @m86194 (hopefully that’s everyone who thumbs’d up/commented…)
v1.6.0 has been released with this feature; prefix your source image configuration with
docker://
to use a base image stored in the Docker daemon.Gradle:
jib.from.image = 'docker://docker-image'
Maven:<from><image>docker://docker-image</image></from>
The first build may be a little slow, depending on how large your base image is, but subsequent builds should be faster once the layers are cached in a Jib-friendly format. We’re still looking into ways to optimize this (#1912, #1913), but until then, if you find that using a docker daemon image is too slow and you have a base image that doesn’t change often, you can consider first
docker save
ing the image, and then pointing to the saved tar using atar://
base image in Jib. This lets Jib skip a step in the execution.Gradle:
jib.from.image = 'tar:///path/to/saved.tar'
Maven:<from><image>tar:///path/to/saved.tar</image></from>
Yeah, as I said, being able to pull images from the local Docker daemon would be an interesting idea.
One workaround for now would be to use a local registry, which is easy to setup, e.g.,
(References: https://hub.docker.com/_/registry and https://docs.docker.com/registry/deploying/)
Then push the base image built locally (would be named like
localhost:5000/something
) to the registry and have Jib pick that up. But I admit this is a bit involved. I like the idea of Jib being able to pull base images directly from the local Docker daemon.