question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for using a local Docker cache for base images

See original GitHub issue

Description 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:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

20reactions
TadCordlecommented, Sep 13, 2019

@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 saveing the image, and then pointing to the saved tar using a tar:// 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>

6reactions
chanseokohcommented, Mar 8, 2019

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.,

$ docker run -d -p 5000:5000 --restart=always --name registry registry:2

(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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found