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
    So, if this is because of the ownership issue, you can definitely change the ownership of /var/lib/jetty using an extension. I know this is not ideal, but I think this is the best I can recommend for now.
    Rodrigo Carneiro
    @r-carneiro
    great, I will using an extension. Thanks for the response!
    Chanseok Oh
    @chanseokoh
    Yeah, note that you'll need to create some extra directories when using the extension due to the known issue of the extension.
    Chanseok Oh
    @chanseokoh
    Just in case: I don't know very well about Jetty, but looks like the file jetty.start gets dynamically created at runtime, which I think is possibly against the container best practice where you want your image to be immutable. That is, ideally the base image (and the final image) should be static and created at compile-time but not at runtime. I'm not sure, but I wonder if you may be able to prepare an immutable base image in advance.
    Chanseok Oh
    @chanseokoh
    @choudh2011 unfortunately, creating/putting a symlink in an image is not supported. :disappointed: The only workaround I can think of is to prepare a custom base image that already has symlinks.
    Chanseok Oh
    @chanseokoh
    BueySD
    @BueySD_twitter
    is there a list of things I can check for when getting java.lang.NoSuchFieldException in a dependency for a jib build using the maven plugin?
    BueySD
    @BueySD_twitter
    happens in exploded mode but not packaged mode
    Chanseok Oh
    @chanseokoh
    @BueySD_twitter is the error when building an image or running your application at runtime? And is there anything particular or unusual about creating a JAR artifact?
    BueySD
    @BueySD_twitter
    this is when running the application at runtime, it looks like the error is thrown during a reflection attempt. nothing really unusual - I was using maven shade plugin to include some messy dependencies but i've removed them as part of dockerizing this app
    Josh Durbin
    @joshdurbin

    Howdy folks; I did a cursory search for an error I'm encountering with jib and, forgive me, it's been a few years since Ive used jib and my Gradle skills are a bit rusty. I have a Gradle file here -- https://github.com/joshdurbin/little-snitch-rules/blob/master/build.gradle where I'm trying to add the plugin per the docs -- id 'com.google.cloud.tools.jib' version '2.5.2' ... with a full build.gradle of:

    plugins {
        id 'groovy'
        id 'application'
    //    id 'com.google.cloud.tools.jib' version '2.5.2'
    }
    
    repositories {
        jcenter()
    }
    
    dependencies {
        compile group: 'io.javalin', name: 'javalin', version: '3.10.1'
        runtime group: 'org.slf4j', name: 'slf4j-simple', version: '1.8.0-beta4'
        implementation 'org.codehaus.groovy:groovy-all:3.0.5'
        testImplementation 'org.spockframework:spock-core:2.0-M3-groovy-3.0'
    }
    
    application {
        mainClassName = 'io.durbs.lsrules.App'
    }

    When I try and execute any gradle task with jib uncommented, it results in:

    ➜  little-snitch-rules git:(master) ✗ gradle      
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/Users/jdurbin/dev/little-snitch-rules/build.gradle' line: 4
    
    * What went wrong:
    Plugin [id: 'com.google.cloud.tools.jib', version: '2.5.2'] was not found in any of the following sources:
    
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Plugin Repositories (could not resolve plugin artifact 'com.google.cloud.tools.jib:com.google.cloud.tools.jib.gradle.plugin:2.5.2')
      Searched in the following repositories:
        Gradle Central Plugin Repository

    ... which I find particularly puzzling because that plugin information was pulled directly from the Gradle Repo itself. I've also tried explicitly defining repos:

    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    Versions:

    little-snitch-rules git:(master)java -version
    gropenjdk version "11.0.8" 2020-07-14
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
    ➜  little-snitch-rules git:(master)groovy -version
    Groovy Version: 3.0.5 JVM: 14.0.1 Vendor: Oracle Corporation OS: Mac OS Xlittle-snitch-rules git:(master)gradle -version
    
    ------------------------------------------------------------
    Gradle 6.6.1
    ------------------------------------------------------------
    
    Build time:   2020-08-25 16:29:12 UTC
    Revision:     f2d1fb54a951d8b11d25748e4711bec8d128d7e3
    
    Kotlin:       1.3.72
    Groovy:       2.5.12
    Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
    JVM:          14.0.1 (Oracle Corporation 14.0.1+14)
    OS:           Mac OS X 10.15.6 x86_64

    What am I doing that's dumb?

    Chanseok Oh
    @chanseokoh
    @joshdurbin for Gradle, the latest is 2.5.0. (OTOH, the latest Maven plugin is 2.5.2. Maven needed a few bug fixes.)
    Josh Durbin
    @joshdurbin
    Oh.
    There's the dumb of mine.
    ... Yeah, which is also what the groovy docs for jib say. I was just taking the latest from the MVN repo.
    Thank you!
    :-)
    Chanseok Oh
    @chanseokoh
    :)
    ushaduddu1
    @ushaduddu1
    hello I am trying to use<extraDirectories>
    <paths>
    <!-- Copies from 'src/main/custom-extra-dir' into '/' on the container. -->
    <path>src/main/custom-extra-dir</path>
    <!-- Copies from '/home/user/jib-extras' into '/extras' on the container -->
    <path>
    <from>/home/user/jib-extras</from>
    <into>/extras</into>
    </path>
    </paths>
    </extraDirectories>
    It does not work
    Chanseok Oh
    @chanseokoh
    @ushaduddu1 it does work :)
    ushaduddu1
    @ushaduddu1
    Unable to parse configuration of mojo com.google.cloud.tools:jib-maven-plugin:2.1.0:build for parameter paths: Basic element 'path' must not contain child elements -> [Help 1]
    which version of jib?
    2.1.0 with version 2.1.0 its failing
    @chanseokoh @ushaduddu1
    Unable to parse configuration of mojo com.google.cloud.tools:jib-maven-plugin:2.1.0:build for parameter paths: Basic element 'path' must not contain child elements -> [Help 1]
    which version of jib? with 2.1.0 its failing with above mvn error
    ushaduddu1
    @ushaduddu1
    image.png
    NVM its working in latest version.. @chanseokoh . thanks for commenting
    Chanseok Oh
    @chanseokoh
    @ushaduddu1 can you try Jib 2.5.2? 2.1.0 is pretty old.
    Stas Chern
    @staswiner

    Hi, i am trying to use Jib on an offline setup.
    uppon running gradle jib i receive the error "Execution failed for task ':jib'.

    com.google.common.collect.ImmutableList.toImmutableList()Ljava/util/stream/Collector;"
    A quick search shows that my guava should be of a proper version, but i took all my dependencies from a hello-world example project, and as such i have no real direction.
    JIB version: 2.5.0

    and guava version 23.6-jre
    thanks for help in advance!
    Chanseok Oh
    @chanseokoh
    @staswiner it is a multi-module project, right? Your project setup isn't correct. See this FAQ to understand how to properly set up a multimodule project.
    Stas Chern
    @staswiner
    @chanseokoh thank you very much kind sir! This was indeed the issue.
    Wlad
    @wlad
    Hi, I'm new to Jib and have question. I have a multi module spring boot project that requires an DB be running to successfully build the application. e.g. I have to first start a properly configured PostgreSQL DB (either natively installed or as a docker container) for mvn clean package to succeed. Can I use Jib in such scenario?
    7 replies
    Wlad
    @wlad
    Does mvn package jib:dockerBuild in contrast tomvn package jib:build mean that resulting image is not pushed to DockerHub registry?
    1 reply
    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