-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for using a local Docker cache for base images #1468
Comments
Hi @menya84. Jib does support using images from private registries as a base image. Could you provide some details? There are some suggestions for fixing connection problems with registries in the Jib FAQ. |
I didn’t mean private registry, I am talking about local image been just built and not pushed anywhere. |
Hi @menya84 , do you mean a local image built with Docker and accessible via your local Docker daemon? |
Yes, exactly. |
Being able to pull images from the cache of a local Docker daemon is an interesting idea. #718 is related, but the difference is that #718 is about not fetching remote metadata but using Jib's local cache. But #718 (comment) actually mentions the idea of using the local Docker daemon. One thing to consider in both cases is the different behavior of Docker and Jib: Docker does not check remote images, while Jib always uses the most up-to-date images. I think it would make sense to not check remote images when using local images, whether Jib's cache or Docker's. |
I think we can use metadata of an image to make sure Jib always uses really latest image. |
Note that this is basically the current behavior, almost, if you haven't noticed. It's just that Jib has its own cache and doesn't use the images in the local Docker daemon for a base image. |
Agree, but the problem arise when we build the base image not using Jib. And usually we build base image just using simple Dockerfile. |
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 |
The same for us. We can't really start using Jib without this feature since we use a custom base image that is build before jibDockerBuild. The workaround with private registry is not well scalable. |
How do you build your base image? What does your build process look like currently? |
Currently we don't use distroless images. We have a base image that shared across all microservices. The base image basically has just an installed java. On a service level we run a packer with chef solo that runs chef recipe to install the tomcat and other stuff. It also copies the war file as part of the process. |
I faced same issue, here are my steps:
It would be great at least look into local docker daemon cache in case of dockerBuild, since it interacts with it in any case. |
@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 Gradle: 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 Gradle: |
Description of the issue:
Expected behavior:
Steps to reproduce:
Environment:
jib-maven-plugin
Configuration:jib-gradle-plugin
Configuration:Log output:
Additional Information:
The text was updated successfully, but these errors were encountered: