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.

Base image metadata (manifest and container configuration) is pulled for every build

See original GitHub issue

Environment:

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

github_iconTop GitHub Comments

1reaction
briandealwiscommented, Aug 1, 2019

Created #1884 as Jib should make it easy to find out the base image digest too

0reactions
TadCordlecommented, Oct 18, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker manifest - Docker Documentation
A manifest list is a list of image layers that is created by specifying one or more (ideally more than one) image names....
Read more >
Using container image digests | Cloud Architecture Center
The image manifest references the configuration object and each of the file system layers using their digest attributes.
Read more >
Understanding and Building Docker Images - JFrog
A practical guide to Docker images. How they work, how to create them, how to optimise them, where to find ready-made images and...
Read more >
Understanding container images - OCI image specification
The image manifest contains references to the image configuration JSON and a set of file system layers used to create the image. The...
Read more >
Docker image Metadata · Codefresh | Docs
How to use custom metadata in your Docker images. ... Build step Image Metadata Annotation ... To annotate a built image, configure any...
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