Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Kino Chou
    @choudh2011
    @chanseokoh thank you for your response.
    danmillwood
    @danmillwood
    Hello, Im using jib core to build an image from scratch. e.g.
    Jib.fromScratch() .addLayer(Arrays.asList(Paths.get("helloworld.sh")), AbsoluteUnixPath.get("/")) .setEntrypoint("sh", "/helloworld.sh") .containerize( Containerizer.to(RegistryImage.named("hello-from-jib") .addCredential(args[0], args[1])));
    I need the image to have a different architecture and os than the defaults of amd64 and linux. I can't find any methods to set these. Is there a way that Im failing to see? Thanks
    2 replies
    John Gasper
    @jtgasper3

    Hi all, I'm wondering if anyone has confirmed that the jib-gradle-plugin actually works when building a non-linux/amd64 image?

    from {
            image = "amazoncorretto:11"
            platforms {
                platform {
                    architecture = 'arm64'
                    os = 'linux'
                }
            }
        }

    cause a response:
    > multi-platform image building is not yet supported

    The gradle plugin docs implies that more than 1 platform is permitted, but that is clearly not the case, so I'm wondering if this a disconnect between the two "teams".
    Chanseok Oh
    @chanseokoh
    @jtgasper3 multi-platform image building is currently blocked until we sort out some lingering issues. However, your configuration should work, since you are defining only one platform. So I don't get how you are hitting the error.
    Let me try to reproduce this locally.
    I can reproduce this. It's a bug. The config currently results in two platforms "amd64" and "arm64". So that's why you're getting the error.
    Chanseok Oh
    @chanseokoh
    :(
    John Gasper
    @jtgasper3
    Thanks for confirming. I'm not a gradle internals dev, but I'm assuming this gets invoked regardless of if I try to override it in the config or not: https://github.com/GoogleContainerTools/jib/blob/master/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BaseImageParameters.java#L48
    John Gasper
    @jtgasper3
    @chanseokoh I can open an issue. Just want to ensure you haven't started to writing it up.
    Chanseok Oh
    @chanseokoh
    I appreciate it.
    Álvaro Sánchez-Mariscal
    @alvarosanchez
    Hi! :wave:
    I'm Álvaro, from the Micronaut team. We are looking to integrate Jib into our Micronaut Maven plugin. I'm working on a PoC by implementing an extension, and have some questions about it
    2 replies
    Mridula
    @mpeddada1

    @/all Jib 2.6.0 has been released!

    Major Changes for Plugins

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

    dsmclaughlin
    @dsmclaughlin
    Hi! I'm new not Jib and google cloud. I'm following the getting started guide here https://cloud.google.com/java/getting-started it asks me to

    "Build the image using Jib:
    mvn package jib:build -Dimage gcr.io/PROJECT_ID/bookshelf
    Replace PROJECT_ID with the Google Cloud project ID that you created."

    however, I get the error "[ERROR] Unknown lifecycle phase "gcr.io/getting-started-292422/bookshelf.... [more stuff] ".

    Can anyone point me in the right direction of the place to ask questions to someone who can help me understand this? Thanks! :)
    7 replies
    Piotr Joński
    @sta-szek
    Hi, is there possibility to generate Dockerfile to some file? i cannot find in docs, i am using maven plugin
    Álvaro Sánchez-Mariscal
    @alvarosanchez
    It's not possible
    Appu
    @loosebazooka
    no, but there are other tools to generate docker files
    Kobi Bar Hanin
    @kobibarhanin
    Hi! I’ve built an interactive git cli - igit. Check it out: https://github.com/kobibarhanin/igit to install: pip install igit
    seanleblancicdtech
    @seanleblancicdtech
    where is the best place to check for all the sha256 hashes to put into annotations like:
    1 reply
    Lukáš Vasek
    @bilak
    Hi, probably asked many times... We have container that is created with jib which is spring boot java application. This is working perfectly. But now, we need to create another container that will execute database migration as job before deployment (as helm hook). For that I'd like to exclude all java stuff from that container to have it smaller and extend the liquibase image. Is it possible to exclude everything that is being included in /app folder inide container? This is wat I have so far
    <plugin>
      <groupId>com.google.cloud.tools</groupId>
      <artifactId>jib-maven-plugin</artifactId>
      <executions>
        <execution>
          <id>liquibase</id>
          <phase>package</phase>
          <goals>
            <goal>dockerBuild</goal>
          </goals>
          <configuration>
            <extraDirectories>
              <paths>
                <path>
                  <from>src/main/resources/db</from>
                  <into>/liquibase/changelog/db</into>
                </path>
              </paths>
            </extraDirectories>
            <container>
              <entrypoint>INHERIT</entrypoint>
            </container>
            <from>
              <image>liquibase/liquibase:3.10</image>
            </from>
            <to>
              <image>liquibase-custom-batching-demo</image>
            </to>        
          </configuration>
        </execution>
      </executions>
    </plugin>
    Chanseok Oh
    @chanseokoh
    @bilak from what I understand, Jib isn't designed for your use case (it's for containerizing Java apps as part of Maven builds). However, Jib has an extension mechanism, and we have a Jib Layer-Filter extension, with which you can remove files. (But you need to understand your workflow is not what Jib is intended for.)
    Lukáš Vasek
    @bilak
    @chanseokoh I understand, but it would be very usefull if it basically suports this. Nowadays when there is kubernetes around each corner and we are building a lot of containers (not just java) this would be super helpful
    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