Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Chanseok Oh
    @chanseokoh
    For the workflow like this, I think Jib CLI which we are working on releasing by EOY may be a better fit. Jib CLI is a general image building tool you can run on the command-line. But for now, perhaps you can use the extension if you want.
    Lukáš Vasek
    @bilak
    Ok thank you very much, I'll try and come back later if I find some issue. Btw would there be also some maven wrapper for jib cli?
    Chanseok Oh
    @chanseokoh
    I don't think we'll have any wrapper around Jib CLI. Maybe Maven already has a plugin to run an arbitrary process?
    Lukáš Vasek
    @bilak
    @chanseokoh this works. Thanks!
    <pluginExtensions>
      <pluginExtension>
        <implementation>com.google.cloud.tools.jib.maven.extension.layerfilter.JibLayerFilterExtension</implementation>
        <configuration implementation="com.google.cloud.tools.jib.maven.extension.layerfilter.Configuration">
          <filters>
            <!-- exclude application -->
            <filter>
              <glob>/app/**</glob>
            </filter>
          </filters>
        </configuration>
      </pluginExtension>
    </pluginExtensions>
    Iain White
    @icewhite
    Can anyone help me with examples of a Spring Boot Maven WAR built and deployed to an image, running in embedded Tomcat (or non-embedded if that's better). I've been trying for days and getting loads of errors getting it running in docker, and I'm not finding much guidance on stack overflow. BTW, seen this already. Can't get any combination of things to work. Any help would be hugely appreciated.
    Chanseok Oh
    @chanseokoh
    @icewhite I strongly recommend going for non-WAR (hence running in embedded Tomcat or Jetty). WAR is like a legacy app in the days resources were expensive where you needed to run multiple WARs on a single application server. The model doesn't fit well with containers these days. Just remove <packaging>war from pom.xml and switch it to a JAR project.
    https://medium.com/@satyajit.nalavade/make-jar-not-war-josh-long-d6ce5fbb8a23#:~:text='%20%E2%80%94%20Josh%20Long,-Satyajit%20Nalavade
    https://medium.com/@compuhosny/make-jar-not-war-ef042a875ed
    Shashank Bellary
    @shashankbellary
    Hello, can any one help me with this? I need to customize jibDockerBuild, what kind of task is jibDockerBuild and how to figure that out
    14 replies
    Mert Açıkportalı
    @Hmerac
    Hey hey :wave:
    We're using jib to containerize our apps and I just realized that using jib with gradle doesn't execute tasks that are not default(compileJava, classes, jar, jib). Is that right? Because gradle jib doesn't fail when tests are failing. Do I need to run gradle build before I use gradle jib to make sure that tests succeed?
    I couldn't see anything like this and I wanted to confirm.
    4 replies
    Lukáš Vasek
    @bilak
    Hello, what about multistep build ...is that somehow possible with jib? I'm looking into openj9 and it's class sharing but that would require me to use openj9 on each developer machine or do some multistep build. I would rather use multi step, but don't think that's supported by jib currently. Is it?
    7 replies
    Manuel Doncel Martos
    @manuelarte

    Hi, when using gradle jib in Circleci I get the following error. any idea?

    `

    • What went wrong:
      Execution failed for task ':jib'.

      com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: com.google.cloud.tools.jib.api.RegistryUnauthorizedException: Unauthorized for registry-1.docker.io/library/openjdk`

    21 replies
    Chanseok Oh
    @chanseokoh

    @/all Jib 2.7.0 has been released!

    Major Changes

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

    Romain Ourgorry
    @romainourgorry
    Hi everyone!
    I'm using gradle Jib and I would like to exclude/ignore some files from my project resources when I build the image with JIB, is it possible? I didn't find how to do it.
    Please help me :)
    1 reply
    Jeroen Lanckmans
    @jeroenlanckmans
    Hi, I created a springboot war in such a way it is also possible to run it using java -jar. Is it now possible to create a jib image that doesn't use an application server? I have the war plugin enabled.
    https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#packaging-executable-wars-deployable
    10 replies
    Stef Daems
    @stefdaems
    After jib build the new docker image, I want to run it, but it immediately crashes messaging
    6 replies
    Álvaro Sánchez-Mariscal
    @alvarosanchez
    Hi. After running gcloud auth configure-docker, all Jib commands are failing with:
    16 replies
    ericzhang
    @shougao
    how to using the docker --link, or network in jib:dockerBuild mode ?
    i check the pom.xml is support the <container> <configuration> <extraDirectories>, no network settings , could somebody help me?
    1 reply
    Petr H.
    @holubec-petr
    Hi, I have a multi-module Gradle project written in Kotlin using Spring Boot. Is there a feasible way how to build a single Docker image using Jib?
    I saw a multi-module example but it creates several images which is not what I want. I have Spring Boot application (usually run as java -jar myApp.jar), divided into Gradle subprojects for better maintainability, but it is still a single app that needs to be in a single container, not separate microservices. Thanks for all hints.
    9 replies
    pppiermarini
    @pppiermarini
    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
    Appu
    @loosebazooka

    @/all Jib 2.7.1 is released!

    Major Changes

    Lorenzo Tramuto
    @loryx636
    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
    @head1328
    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
    @cynicaljoy
    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
    Orhan
    @yilmazorhan
    Hi, is it possible to extend jibdockerbuild task such as task customtask(type: DockerBuildTask) etc.
    Orhan
    @yilmazorhan
    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
    tjuricek-vmware
    @tjuricek-vmware
    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
    Srinivas
    @Sriniva63328880_twitter
    Hi
    Georgios Andrianakis
    @geoand

    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.

    Thanks!

    12 replies
    Sabrina Peoples
    @peoples_sabrina_twitter
    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
    dev-samples
    @dev-samples
    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
    @tjtaill
    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] "code": "TOOMANYREQUESTS",
    [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]
    [ERROR] -> [Help 1]
    [ERROR]
    [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]
    [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
    Sachith
    @SachithS

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

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

    Peter
    @hide42
    Can gradle throw an exception when executing the jib stage if such an image already exists ?
    1 reply
    yuzd
    @yuzd
    how to config Volumes?
    2 replies
    Ed Randall
    @edrandall
    Hi all,
    Ed Randall
    @edrandall
    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
    @mauroz77
    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
    @sobychacko
    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
    Mridula
    @mpeddada1
    @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
    nicholascowan
    @nicholascowan
    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?
    Mridula
    @mpeddada1
    @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
    @npepinpe
    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
    @taer
    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
    @chebetos

    Hi,

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

    https://github.com/GoogleContainerTools/jib/blob/master/docs/default_base_image.md

    But is not clear to me the reason,

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

    Chanseok Oh
    @chanseokoh

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

    Major Changes

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

    1 reply