Base image metadata (manifest and container configuration) is pulled for every build
See original GitHub issueEnvironment:
- Jib version: 1.4.0
- Build tool: maven 3.6.1
- OS: Windows 10
Description of the issue:
We would like for JIB to only consult the registry containing the from-image, if that image is not already cached. Currently it appears that this happens for each and every build (probably to see if the image has been updated). For our purposes we are fine with just populating the cache once, and then use that entry for the lifetime of the instance (pod). If we need updating, we just restart the pod.
Expected behavior:
Registry containing from-image is only contacted at all if image is not cached. If cached, no network traffic should happen. This can emulated with a VERY long timeout before trying to refresh a cache entry.
This should be settable as a pom-entry, and overridable from the command line.
Steps to reproduce:
Any build. For our proof-of-concept build, we use “adoptopenjdk/openjdk11:slim” as the from image.
jib-maven-plugin
Configuration:
<plugin>
<!-- https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin -->
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<container>
<ports>
<port>8080</port>
</ports>
</container>
<from>
<!-- https://stackoverflow.com/a/52431765/53897 -->
<image>adoptopenjdk/openjdk11:slim</image>
</from>
<to>
<image>${docker.image.local.name}</image>
</to>
<extraDirectories>
<paths>
<path>extra-directory-for-jib</path>
</paths>
</extraDirectories>
<dockerClient>
<environment>
<key3>value3</key3>
<key4>value4</key4>
</environment>
</dockerClient>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
</plugin>
Additional Information:
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (7 by maintainers)
Top GitHub Comments
Created #1884 as Jib should make it easy to find out the base image digest too
@m86194 We just released 1.7.0, which will not pull the manifest on every build if you specify the base image with a digest.