Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Hello, I'm new to jib and have read the documentation, it is unclear if the maven jib plugin supports the maven release plugin, I can't seem to get it working. Can anyone help or link me to an example?
    10 replies

    @/all Jib 2.7.1 is released!

    Major Changes

    Lorenzo Tramuto
    Hello, thanks for this product! How can I set the timezone of the created docker container? I've 1 hour earlier on logs respect host machine
    1 reply
    Kevin Horst
    general question: does jib need the docker binary? if I want to package my project with an official maven docker image I get: Caused by: java.io.IOException: Cannot run program "docker": error = 2, No such file or directory
    10 replies
    Darren Cunningham
    When I rebuild my project without making any code changes I'm ending up with a new digest for the created OCI with jib - my base image has a digest rather than tag so that shouldn't be it -- what else should I check?
    23 replies
    Hi, is it possible to extend jibdockerbuild task such as task customtask(type: DockerBuildTask) etc.
    this works fine if anyone needs it. if you have better solution please let me know.
    task buildLocalImage(dependsOn:copyReleaseJar, type: com.google.cloud.tools.jib.gradle.BuildDockerTask) {
        jibExtension = project.extensions.getByName('jib')
        doFirst {
            jib.from.image = 'adoptopenjdk:15-jre-openj9'
            jib.dockerClient.executable =  isMac() ? '/usr/local/bin/docker' : 'docker'
        outputs.upToDateWhen { false }
    5 replies
    Are there any official forks or plugins that are working with jlink? I've found a snippet here, but I'm very curious if there's a discussion on workflows with jib and jlink.
    1 reply
    Georgios Andrianakis

    Hi folks,

    Is there anyway I can make Jib preserve the timestamps of files when I add layers?
    The reason I am interested in this is because I am trying to automate the generation of AppCDS (Application Class Data Sharing) in Quarkus when a container image build is requested via Jib.
    Everything works fine until the point where the JDK checks the timestamps of the jars are on the classpath (to ensure that what is in the shared archive matches what is on the supplied runtime classpath) at which point it fails - because the timestamps of the jars have changed when they were added to the layer.

    Is there anything that can be done on the Jib side?
    Just as a note, we use Jib core directly in Quarkus, so I can change how we interact with Jib at will - we don't use the Maven or Gradle plugins.


    12 replies
    Sabrina Peoples
    Hi, I'm new to jib. I've worked out how most of it. I was getting a decent sized docker spring boot image with java 11.. about 218 mg. I then tested with amazon corretto 11, because that's what i'll need to use, and ended up with an image over 500 mg! The project is new, so all i have is the main spring boot class. Has anyone had luck with corretto ?
    2 replies
    Hi, anywhere I can see the latest version of jib-gradle-plugin that can be used with gradle 4.10.3? As of now I am prevented from upgrading from gradle 4.10.3 but I would still like to test out jib-gradle-plugin. I have read: https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin which says '2.7.1' requires at least gradle 5.1 but are the some docs where I can see the latest jib-gradle-plugin version for gradle 4.10.3? UPDATE: Through some trial and error I got it to work with "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:1.8.0" as the latest. But still interested in any docs with compatible versions - if exists.
    1 reply
    Troy Taillefer
    Hi all I am really loving jib but having an issue when running it from maven plugin inside aws codebuild it sporadically gives me to many requests errors
    Container] 2021/02/08 00:40:08 Running command mvn -q compile jib:dockerBuild -Djib.to.image=$IMAGE_REPO_URL:$TAG -Djib.to.credHelper=ecr-login -Djib.jvmFlags=-Dspring-boot.run.profiles=prod
    [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.7.1:dockerBuild (default-cli) on project rest-event-box: 429 Too Many Requests
    [ERROR] GET https://registry-1.docker.io/v2/library/openjdk/manifests/11-jre-slim
    [ERROR] {
    [ERROR] "errors": [
    [ERROR] {
    [ERROR] "message": "You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"
    [ERROR] }
    [ERROR] ]
    [ERROR] }
    [ERROR] -> [Help 1]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    Is there way to fix this jib and the plugin are really cool but I need my CI to work consistently ?
    6 replies

    Hi @All

    I am new to the maven Jib plugin and is there a way to copy the custom file locations to the container.
    ie. my build files (npm) are in project_base/build and index.html in project_base which I should copy to the container. Any help would be helpful.

    3 replies
    Chanseok Oh

    @/all Jib Maven/Gradle plugins 2.8.0 and Jib Core 0.18.0 have been released!

    Major Changes for Build Plugins

    Major Changes for Jib Core

    See CHANGELOG.md (Jib Maven plugin / Jib Gradle plugin / Jib Core) for more details.

    Can gradle throw an exception when executing the jib stage if such an image already exists ?
    1 reply
    how to config Volumes?
    2 replies
    Ed Randall
    Hi all,
    Ed Randall
    I recently optimised our (maven) Jib build using the JibLayerFilterExtension
    With the help of "dive" (wagoodman/dive) I've been further investigating optimising the image; Is there any way to divert files into the existing layers which Jib already creates? To do that I'd need to know the magic textual names for those layers, and use the same name in the layer filter rule I suppose.
    Also, is there a way to control the order of the layers, so I can put my filtered files underneath the application code? The filtered layers seem to be in declaration order, with the last one at the top of the stack (if base-image is at the conceptual bottom)
    3 replies
    Mauricio Martinez
    Hi! Thanks for the great work with Jib. I'm creating a deployment in kubernetes and need some data in the container. The way I've used with other images is kubectl cp <file-spec-src> <file-spec-dest>, being <file-spec-dest> the pod with the container where I need the data. As the kubernetes documentation explains: "Requires that the 'tar' binary is present in your container # image. If 'tar' is not present, 'kubectl cp' will fail". In fact, if I run that command in a pod with a jib container, it fails: "OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"tar\": executable file not found in $PATH": unknown". Is there any workaround/configuration for such cases? Thanks a lot
    5 replies
    Soby Chacko
    Hi, It looks like jib doesn't allow pushing to two different registries as part of a single build: GoogleContainerTools/jib#2299
    The solution mentioned there is to parameterize jib.to.image. Doesn't that create two different sha digests for the two builds? I wonder if there are any issues with that. Is there a way to ensure that the same image is pushed to both registries with the same digest? Thank you!
    7 replies
    @all, We are excited to introduce the Jib CLI in preview!
    Do you want to try out Jib without having to integrate it with your build system? You can now experience Jib’s fast and reproducible container building in a standalone application! Check out the Jib CLI Github page if you’re interested in learning more → https://github.com/GoogleContainerTools/jib/blob/master/jib-cli/README.md
    Can someone tell me if I'm doing something wrong with volumes, my image doesn't seem to actually mount <configuration> <from> <image>openjdk:8-jre-alpine</image> </from> <to> <image>cms</image> </to> <container> <volumes> <volume> /mydirectory </volume> </volumes> </container> </configuration>
    16 replies
    if it makes any difference, it's a windows host, when I go into docker console and run df I don't see it mounted, am I missing anything here?
    @all Jib CLI 0.5.0 has been released!
    Major Changes:
    • Fixed an issue where critical error messages (for example, unauthorized access from a registry) were erased by progress reporting and not shown. (GoogleContainerTools/jib#3148)
    • [Starting with jib-cli 0.4.0] Added support for configuring registry mirrors for base images. This is useful when hitting Docker Hub rate limits. Only public mirrors (such as mirror.gcr.io) are supported. (GoogleContainerTools/jib#3134)
      See CHANGELOG.md for more details.
    Nicolas Pepin-Perreault
    Hi everyone! Quick question about the volumes, ownership, and non-root users: we currently build our images manually and would like to migrate to Jib. However, one requirement is that the image can be run as non-root (e.g. on Openshift). Since our application is stateful, we typically just mount a volume to a /data folder, where the non-root user needs write access. I'm trying to figure out how to make this happen with Jib.
    19 replies
    Robert Macaulay
    Hi y'all. Got a jib running in a docker container question. When I run jibDockerBuild on my build machine, I get this error. I don't get it in a non-docker environment.
    [2021-04-14T21:33:00.939Z] > java.io.IOException: Failed to open or parse global Jib config file; see https://github.com/GoogleContainerTools/jib/blob/global-config-doc/docs/faq.md#where-is-the-global-jib-configuration-file-and-how-i-can-configure-it to fix or you may need to delete ?/.config/google-cloud-tools-java/jib/config.json
    24 replies
    César Augusto Delgado Rodríguez


    I just realized that the base image for java projects has been changed from distroless to adoptopenjdk.


    But is not clear to me the reason,

    is it distroless deprecated?
    is it distroless discouraged to use?

    1 reply
    Chanseok Oh

    Jib Maven and Gradle plugins 3.0 was out a week ago.

    Major Changes

    See CHANGELOG.md (Maven / Gradle) for more details.

    5 replies

    Hey, I'm trying to set up jib with gradle and spring boot.

    My gradle setup just used to build bootJar and I run it as an ordinary shell script ./app.jar - using launch script spring boot feature.
    This allowed me to externalize some properties to OS environment variables like so spring.datasource.url=${DB_URL} in application.properties.

    But as of now I have added jib plugin and for created container I see Container entrypoint set to [java, -cp, /app/classpath/*:/app/libs/*, com.primeinsights.portal.alert.AlertAppKt] from gradle logs. And with such setup OS environment variables seems to be ignored by spring boot.

    Any thoughts on what I have missed in jib configuration to make this work? I use version 3.0.0 of gradle jib plugin.

    2 replies
    James Todd
    digging jib via gradle! q: how would one exclude a resource (in [project]/build/main/resources) from being included in the jib'd image? i can think about adding a doFirst() hack to remove the file but hoping for something cleaner within jib proper, didn't see anything obvious in the jib docs. thx!
    2 replies

    @/all Jib CLI 0.6.0 has been released!

    Major Changes

    • Added automatic update check. Jib CLI will now display a message if a new version is available. See the privacy page for more details. (GoogleContainerTools/jib#3165)
    • Added --image-metadata-out option to specify the JSON output file that should contain image metadata (image ID, digest, and tags) after build is complete. (GoogleContainerTools/jib#3187)

    See CHANGELOG.md for more details.

    Neat! What's the roadmap look like for native-image support?
    I've tried building my own project using jib using native-image, but got hung up on some reflection nonsense.
        ... 8 more
    Caused by: java.lang.IllegalAccessException: Cannot set final field: com.google.cloud.tools.jib.image.json.V22ManifestListTemplate.mediaType. Enable by specifying "allowWrite" for this field in the reflection configuration.
        at java.lang.reflect.Field.set(Field.java:780)
        at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:150)
    V22ManifestListTemplate and a few others have private final fields such as schemaVersion and mediaType, which it looks like jackson is overriding by default.
    And then there are classes such as RootFilesystemObjectTemplate which say the type must always be "layers", but if jackson can modify the final field then that's not exactly guaranteed.
    An example attempt at fixing this can be found here. GoogleContainerTools/jib#3225 It does solve the issue (for this one class)
    Chanseok Oh
    @sineaggi:matrix.org we hit this before. I left a comment in your PR: https://github.com/GoogleContainerTools/jib/pull/3225#issuecomment-830142245
    @chanseokoh: I'm not super in love with the solution, I figured at the very least jackson reflecting into final fields is probably pretty bad, and that I'd want to avoid having to enable {"name":"finalValue", "allowWrite": true} if at all possible
    the Preconditions.checkArgument might be overkill, but at least the @JsonCreator takes care of the final field issue
    If we don't mind the fields being changed by jackson, the fields could also be made non-final instead
    1 reply
    Dan Millwood
    Hello, is it possible with jib-core, to build an OCI image to a local disk cache, and at a later time, push the image from the local disk cache to an image registry, rather than doing the build and push as a single step?
    7 replies
    I'm trying to understand the point of <volumes><volume> in JIB (Maven). It creates a directory in the image but how is that useful until it is mounted using the docker command "-v"? Point being why not just use "docker -v" to begin with?
    1 reply
    Can I put the result of spring-boot-maven-plugin into the jib container?
    1 reply
    James Todd

    hi. i'd like to push the image to aws-ecr and as such have configured a credsHelper as the jib docs suggest and am running into the following error, noting the what looks to be typo in the tool name:

    ...The system does not have docker-credential-erc-login CLI

    i have brew installed docker-credential-ecr-login. thoughts?

    1 reply
    Nuwan Sanjeewa Abeysiriwardana
    Hi, i'm getting following error with java 15
    Your project is using Java 15 but the base image is for Java 11, perhaps you should configure a Java 15-compatible base image using the '<from><image>' parameter, or set maven-compiler-plugin's '<target>' or '<release>' version to 11 or below in your build configuration
    2 replies
    hi, I'm running mvn compile - > no changes detected.
    however jib:build keeps pushing an image ,even subsequent calls to jib:build keeps building and pushing an image
    I'm using jib 3.0.0, tried adding a digest to the from image, it removed the warning but still jib pushes the image.
    from debugging I can see jib mostly skips pushing but sometime it does push,
    e.g: Pushing container configuration
    [DEBUG] TIMING Pushing BLOB digest: sha256:421a640eac902e271f90912cfc98a9be9b7667a23d0d1b22efbd76dc94318279, size: 6252
    TIMED Pushing container configuration : 833.0 ms
    [DEBUG] TIMING Preparing manifest pushers
    [DEBUG] TIMED Preparing manifest pushers : 4.0 ms
    [DEBUG] TIMING Pushing manifest
    ultimately I want to skip the push if there were no code changes,
    thanks for any help
    7 replies