Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ryan Schachte
    @Schachte
    Hey guys. Getting this issue: "but failed because: Registry may not support pushing OCI Manifest or Docker Image Manifest Version 2, Schema 2". I'm using gradle, the format is Docker, not OCI. This is underneath the Container closure in Gradle. Am I missing something obvious?
    2 replies
    Stephan H. Wissel
    @Stwissel

    Trouble overwriting a file from a base image.
    I have the following snippet in my maven pom:

    <extraDirectories>
       <paths>
           <from>src/main/docker/sysconfig</from>
        <into>/etc/sysconfig</into>
       </paths>
    </extraDirectories>

    The directory sysconfig exists in my base image. No files are copied. What do I miss?

    1 reply
    Chanseok Oh
    @chanseokoh
    Try <paths><path><from>.... It is likely that /etc/config is recognized as another extra directory. (Maven ignores an XML element name for a list configuration.)
    Ian Davidson
    @iandavidson

    Hello, is there a way to provide a command line argument in order to forgo a property defined?

    For jib on my local machine, I use: jib.to.credHelper=osxkeychain.

    But for building/publishing in CI environment, I want to use specific credentials, while omitting property defined at jib.to.credHelper. Is this possible?

    5 replies
    Prathamesh
    @im-pratham
    Hi, my base image has USER directive, and I create target image with extraDirecties configuration. I can see target files are owned by root. Is that intentional? What will be best practice to put executable file in image and own by non-root user?
    4 replies
    Chanseok Oh
    @chanseokoh

    Jib Build Plugins 3.1.0 Release

    Major Changes

    • For Google Artifact Registry (*-docker.pkg.dev), Jib now tries Google Application Default Credentials last like it has been doing for gcr.io. (GoogleContainerTools/jib#3241)
    • Jib now creates an additional layer that contains two small text files: /app/jib-classpath-file and /app/jib-main-class-file. They hold, respectively, the final Java runtime classpath and the main class computed by Jib that are suitable for app execution on JVM. For example, with Java 9+, setting the container entrypoint to java --class-path @/app/jib-classpath-file @/app/jib-main-class-file will work to start the app. (This is basically the default entrypoint set by Jib when the entrypoint is not explicitly configured by the user.) The files are always generated whether Java 8 or 9+, or whether jib.container.entrypoint is explicitly configured. The files can be helpful especially when setting a custom entrypoint for a shell script that needs to get the classpath and the main class computed by Jib, or for GoogleContainerTools/jib#2471. (GoogleContainerTools/jib#3280)
    • For Java 9+ apps, the default Java runtime classpath explicitly lists all the app dependencies, preserving the dependency loading order declared by Gradle. This is done by changing the default entrypoint to use the new classpath JVM argument file (basically java -cp @/app/jib-classpath-file). As such, jib.container.expandClasspathDependencies takes no effect for Java 9+. (GoogleContainerTools/jib#3280)
    • Timestamps of file entries in a tarball built with jibBuildTar are set to the epoch, making the tarball reproducible. (GoogleContainerTools/jib#3158)
    • (Gradle) Added lazy evaluation for jib.container.labels using Gradle Property and Provider. (GoogleContainerTools/jib#3242)
    See CHANGELOG.md (Maven / Gradle) for more details.
    Chanseok Oh
    @chanseokoh
    We released Jib build plugins 3.1.1 with the following hotfix:
    • Fixed the regression introduced in 3.1.0 where a build may fail due to an error from main class inference even if jib.container.entrypoint is configured. (GoogleContainerTools/jib#3295)
    Mridula
    @mpeddada1

    @/all Jib Core 0.19.0 has been released!

    Major Changes for Jib Core

    • JavaContainerBuilder#fromDistroless() and JavaContainerBuilder#fromDistrolessJetty() are deprecated. To migrate, check the Javadoc. (GoogleContainerTools/jib#3123)
    • Timestamps of file entries in a built TarImage are set to the epoch, making the tarball reproducible. (GoogleContainerTools/jib#3158)

    See CHANGELOG.md (Jib Core) for more details.

    Philip Bannon
    @BannonPhilip_twitter
    Hi @/all, I'm struggling to understand, is there any guides on how i can use Jib and cloud build together? thanks
    17 replies
    Ryan Schachte
    @Schachte
    Hey team. Trying to copy a config file from my repo into my custom image I'm building with Jib. I'm using Gradle. Any chance someone can point me in the right direction?
    3 replies
    Mridula
    @mpeddada1

    @/all Jib CLI 0.7.0 has been released!
    Major Changes

    • Added the war command which can be used to containerize a standard WAR with $ jib war --target ... my-app.war. The command will explode out the contents of the WAR into optimized layers on the container. (GoogleContainerTools/jib#3285)

    See CHANGELOG.md for more details.

    PranobSam
    @PranobSam
    Hello i am new to jib and trying to integrate with private gitlab registry
    and facing issue with the as it complain abt gloab config.json
    i even passed -Djib.auth.name and password parameter
    but has not be successful any1 can guide please
    mvn compile jib:build \
    -Djib.to.auth.username=${CI_REGISTRY_USER} \
    -Djib.to.auth.password=${CI_REGISTRY_PASSWORD} \
    -Djib.to.image=${CI_REGISTRY_IMAGE}:latest
    this is what i passed in my gitlab-ci
    34 replies
    dave08
    @dave08
    Hi! I'm using the most recent version of Jib, but I got the error (in the thread):
    7 replies

    It's a multi-module project, the build seems to complete, but when getting to:

    [======                        ] 20.0% complete    
    > building dependencies layer    
    > building project dependencies layer    
    > building classes layer    
    > building resources layer    
    

    it fails

    PranobSam
    @PranobSam
    Hello team i need to create custom labels and pass it to the Image as metadata in gitlab ci, can i pass it as parameter or it has to be only in POM.XML. is there any other way to do that
    1 reply
    ?
    Chanseok Oh
    @chanseokoh

    @/all Jib Build Plugins 3.1.2 released with the following bug fix:

    • Fixed the bug introduced in 3.1 that constructs a wrong Java runtime classpath when two dependencies have the same artifact ID and version but different group IDs. The bug occurs only when using Java 9+ or setting jib.container.expandClasspathDependencies. (GoogleContainerTools/jib#3331)

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

    Ritika Mittal
    @ritika1701
    Hello. I have got a query. In the entry point of jib maven plugin if I give command /bin/bash -c scripts/test.sh and in the extradirectory copy the files. Will the image run. I know it's of no meaning to use jib when I have to run bash script only. But I have a need here.
    2 replies
    Rafal Klys
    @whut
    Is there any benefit of setting jib.applicationCache to some shared dir in Maven? I understand that for Gradle with its incremental build jib can be informed by Gradle that there is no need to build the application layer, so instead it use the cached one. But for what I understand, there is no such feature in Maven, so setting jib.applicationCache does not help with anything, right?
    Rafal Klys
    @whut
    Ok, if I understood this properly (especially the part about selectors), the Jib itself can do cache invalidation, does not need Gradle for that, which means that it works also in Maven
    but it would be good to have some second confirmation:)
    1 reply
    Ritika Mittal
    @ritika1701
    Hello . How can I install jq in docker image built with jib maven plugin.
    1 reply
    Philip Bannon
    @BannonPhilip_twitter
    Hi All, sorry if this has been asked before. Using JIB and cloud run / build where should I be setting my Java applications Xmx settings?
    4 replies
    sineaggi
    @sineaggi:matrix.org
    [m]
    I've been working on a patch that adds chunked upload support to jib here https://github.com/GoogleContainerTools/jib/compare/master...Sineaggi:chunked-uploads When testing I found it worked for gitlab's private registry, but github fails. Also the whole withOffsetAndLength thing is a bit ugly. Thoughts?
    1 reply
    sineaggi
    @sineaggi:matrix.org
    [m]
    @chanseokoh: That's what I was going to work on next, along with potential retries on network error. Figured I'd get some input first.
    sineaggi
    @sineaggi:matrix.org
    [m]
    @chanseokoh: the sole response from github is {"errors":[{"code":"BLOB_UPLOAD_INVALID","message":"blob upload invalid"}]}
    sineaggi
    @sineaggi:matrix.org
    [m]
    ok range on github is perpetually responding with 0-<content-length>, whereas gitlab and local docker registry respond with 0-<total length sent>
    sineaggi
    @sineaggi:matrix.org
    [m]
    github's response is always
    DEBUG org.apache.http.headers - http-outgoing-10 << HTTP/1.1 202 Accepted
    DEBUG org.apache.http.headers - http-outgoing-10 << Content-Length: 0
    DEBUG org.apache.http.headers - http-outgoing-10 << Content-Type: application/json
    DEBUG org.apache.http.headers - http-outgoing-10 << docker-distribution-api-version: registry/2.0
    DEBUG org.apache.http.headers - http-outgoing-10 << range: 0-33
    like it's only accepting and overwriting the first 34 bytes over and over again
    sineaggi
    @sineaggi:matrix.org
    [m]
    Github upload succeeds in two cases: one where all of the data is uploaded in the final put and no patchs are sent (with the current code in the branch) or if all the data is sent in a patch, and then completed with an empty put (simple change to the for loop). Multiple patchs is where I start hitting troubles with github.
    Chanseok Oh
    @chanseokoh
    Hmm... it's concerning that they don't support it. Are you using the legacy docker.pkg.github.com or the new ghcr.io?
    sineaggi
    @sineaggi:matrix.org
    [m]
    Yep for sure the new ghcr.io, authenticated with a personal token. That 34 bytes is arbitrary btw, just the chunk size i was using during testing (these are very small test layers).
    i couldn't find a way to configure the docker cli to push using smaller chunk sizes to test github
    Chanseok Oh
    @chanseokoh
    The chunked upload is nice, but a major repo like ghcr.io doesn't support it, I think we need to be very careful about the implementation.
    sineaggi
    @sineaggi:matrix.org
    [m]
    i was going to report the bug to github unless anybody here saw anything obviously wrong with my code.
    Chanseok Oh
    @chanseokoh
    Yeah yeah maybe you should file a bug.
    12 replies
    ZealousMacwan
    @ZealousMacwan
    I don't want to push image to registry but only to build locally. Can anyone help me with that?
    Charlie Hubbard
    @chubbard
    I just installed jib as a plugin, but I'm getting the following error:
    > No signature of method: build_4hsbqpanwhbni660d2nicy9gi.jib() is applicable for argument types: (build_4hsbqpanwhbni660d2nicy9gi$_run_closure5) values: [build_4hsbqpanwhbni660d2nicy9gi$_run_closure5@1889c7ed] I have a jib {...} closure block to configure the jib task, but it's throwing that error when I refresh the project in Intellij.
    I'm using the latest version 3.1.3
    Charlie Hubbard
    @chubbard
    Nvm it was something else.
    Daniel Zou
    @dzou

    @ZealousMacwan -- Hey, try these instructions for building an image to a local docker daemon with Jib: https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#can-i-build-to-a-local-docker-daemon

    I think this is what you want.

    Cristiano Gavião
    @cvgaviao

    Hello all!
    I had a multi-stage dockerFile where I'm setting up graalvm environment, copying the jars from my project and then building a native image in the first layers, and then copying the resulting artifacts to the last layer.

    Would this kind of building scenario be possible using Jib?

    3 replies
    yverrette
    @yverrette

    I have been using jib on various projects for more than a couple years. Had a problem recently with AWS Fargate where running local version of container on a mac would work fine and running on AWS errored out due to duplicate methods. Somehow the classes load order changed from local container to AWS. Same application had similar issue with just a restart on Fargate where again classes load order failed the application launch (missing method on the core version of a transitive lib version).

    I understand that I can look for duplicate methods and fix this at build time but Spring Boot already has mechanism to enforce class load order through JarLauncher. Is there a mechanism in jib to enforce class load order?

    3 replies
    Cristiano Gavião
    @cvgaviao

    Hi all,
    I was trying to containerize a legacy project where its JAR contains multiple entry points (classes with main() method). All those different classes are called by a scheduler and using a *.sh script.

    But Jib gave me an error because of the multiple valid main classes.

    Is there any way to work around this need to have a single entry point?

    1 reply