Git Product home page Git Product logo

jib's Introduction

stable Maven Central Gradle Plugin Portal Build Status Build Status Build Status SLSA 3 Gitter version

Jib

Jib - Containerize your Java applications.

β˜‘οΈ Jib User Survey
What do you like best about Jib? What needs to be improved? Please tell us by taking a one-minute survey. Your responses will help us understand Jib usage and allow us to serve our customers (you!) better.

What is Jib?

Jib builds optimized Docker and OCI images for your Java applications without a Docker daemon - and without deep mastery of Docker best-practices. It is available as plugins for Maven and Gradle and as a Java library.

Jib works well with Google Cloud Build. For details, see how to use Jib on Google Cloud Build.

For more information, check out the official blog post or watch this talk (slides).

Goals

  • Fast - Deploy your changes fast. Jib separates your application into multiple layers, splitting dependencies from classes. Now you don’t have to wait for Docker to rebuild your entire Java application - just deploy the layers that changed.

  • Reproducible - Rebuilding your container image with the same contents always generates the same image. Never trigger an unnecessary update again.

  • Daemonless - Reduce your CLI dependencies. Build your Docker image from within Maven or Gradle and push to any registry of your choice. No more writing Dockerfiles and calling docker build/push.

Quickstart

Examples

The examples directory includes the following examples (and more).

How Jib Works

Whereas traditionally a Java application is built as a single image layer with the application JAR, Jib's build strategy separates the Java application into multiple layers for more granular incremental builds. When you change your code, only your changes are rebuilt, not your entire application. These layers, by default, are layered on top of an OpenJDK base image, but you can also configure a custom base image. For more information, check out the official blog post or watch this talk (slides).

See also rules_docker for a similar existing container image build tool for the Bazel build system.

Need Help?

A lot of questions are already answered!

For usage questions, please ask them on Stack Overflow.

Privacy

See the Privacy page.

Get involved with the community

We welcome contributions! Here's how you can contribute:

Make sure to follow the Code of Conduct when contributing so we can foster an open and welcoming community.

Disclaimer

This is not an officially supported Google product.

jib's People

Contributors

alicejli avatar briandealwis avatar chanseokoh avatar coollog avatar cyrilleh avatar dependabot[bot] avatar elefeint avatar elharo avatar emmileaf avatar erdi avatar github-actions[bot] avatar glaforge avatar larsgrefer avatar laurentsimon avatar lightoze avatar loosebazooka avatar louismurerwa avatar meltsufin avatar mhitchens avatar mpeddada1 avatar onecricketeer avatar paivagustavo avatar rajovictor avatar rmannibucau avatar rquinio avatar sineaggi avatar sullis avatar tadcordle avatar yahavi avatar zhumin8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jib's Issues

Refactor User-Agent injection.

User-Agent is currently passed in to the RegistryClient in BuildImageMojo with RegistryClient.setUserAgentSuffix(USER_AGENT_SUFFIX);.

Reorganize build steps for parallelization.

From GoogleContainerTools/minikube-build-tools-for-java#62 and GoogleContainerTools/minikube-build-tools-for-java#120

The new dependency graph:

Leaves:

  • authPull
  • authPush
  • buildAppLayer (dependencies)
  • buildAppLayer (classes)
  • buildAppLayer (resources)

Internal Nodes:

  • pullBase
    • depends on: authPull
  • many of pullBaseLayer
    • each depends on: pullBase
  • many of pushBaseLayer
    • each depends on: corresponding pullBaseLayer
  • pushContainerConfiguration
    • depends on: buildAppLayer (dependencies), buildAppLayer (resources), buildAppLayer (classes)
  • pushAppLayer (dependencies)
    • depends on: buildAppLayer(dependencies)
  • pushAppLayer (resources)
    • depends on: buildAppLayer(resources)
  • pushAppLayer (classes)
    • depends on: buildAppLayer(classes)
  • pushImageManifest
    • depends on: every pushBaseLayer, every pushAppLayer, pushContainerConfiguration

Allow use of multiple credential helpers.

This is part of #22 and fixes #50 .

Replace configuration credentialHelperName with credentialHelpers:

Example:

<credentialHelpers>
  <credentialHelper>gcr</credentialHelper>
  <credentialHelper>ecr-login</credentialHelper>
</credentialHelpers>

For both pull and push, get credentials for the respective registries by trying each of the credentialHelpers.

Add more suggestions for various build failures.

When running mvn jib:build, there are various failures caught in the BuildImageMojo#buildImage method. These catches provide extra feedback to the user to help them understand the issue and provide suggestions for how to fix the issue.

The actionables are to:

  1. Figure out what other build failures there are, if any (compile a list and maybe add that below)
  2. Add similar handling for these build failures.
  3. (Maybe improve how these failures are handled currently)

Build failures to handle:

  • Could not find or load main class Just noticed #189 is already a thing
  • "Unknown host" when registry is misconfigured
  • "Obtaining project build output files failed" when project hasn't been compiled yet (e.g. running mvn clean jib:build)
  • "Unable to parse configuration of mojo: Cannot convert x to Enum" if imageFormat isn't Docker or OCI
  • Unrecognized JVM flag (See #192)

Jib fails the build with long filenames (>100 bytes)

Description of the issue:
When building with some long protobuf filenames, Jib breaks with an error that the filename is too long.

Expected behavior:
It should build anyways because we all know how long Java filenames can get, especially with paths included.

Steps to reproduce:

  1. have an app with deep proto import paths
  2. use a long name for a proto
  3. make sure the combined values are over 100 bytes
  4. ask Jib to build an image with them in it

Environment:
Jib: 0.1.1-SNAPSHOT

Maven:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"

IntelliJ:

IntelliJ IDEA 2018.1 EAP (Ultimate Edition)
Build #IU-181.3494.3, built on February 6, 2018
IntelliJ IDEA EAP User
Expiration date: March 8, 2018
JRE: 1.8.0_152-release-1136-b5 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.3

jib-maven-plugin Configuration:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.sample</groupId>
    <artifactId>java-sample</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <app.version>latest</app.version>
        <app.project>(redacted)</app.project>
        <app.repository>(redacted)</app.repository>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>4.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>24.0-jre</version>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>3.5.1</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty</artifactId>
            <version>1.9.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>1.9.0</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>1.9.0</version>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.5.0.Final</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.5.0</version>
                <configuration>
                    <protocArtifact>com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier}</protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.9.0:exe:${os.detected.classifier}</pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>0.1.1-SNAPSHOT</version>
                <configuration>
                    <registry>us.gcr.io</registry>
                    <repository>${app.project}/${app.repository}</repository>
                    <from>us.gcr.io/${app.project}/v2-java:${app.version}</from>
                    <jvmFlags>
                        <jvmFlag>-Xms512m</jvmFlag>
                    </jvmFlags>
                    <mainClass>(redacted)</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Log output:

...
[INFO] RUNNING	Pushing new image
[INFO] Pushing new image : 0.172 ms
[INFO] Building and pushing image : 9203.004 ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.573 s
[INFO] Finished at: 2018-02-12T14:17:09-08:00
[INFO] Final Memory: 34M/786M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.1.1-SNAPSHOT:build (default-cli) on project platform: Build image failed: file name 'app/classes/com/<really_long_path>/LocationIntegrationSettings$GenericDefaultEntryHolder.class' is too long ( > 100 bytes) -> [Help 1]

Add integration test for various project configurations.

  • Simple project
  • Empty project (no dependencies/no resources/an empty main class)
  • Blank project (no dependencies/no resources/no classes)
  • Multi-module project with single root build script (Gradle)
  • Multi-module project with Maven
  • Complex project (using every parameter)
  • Build as OCI image format (requires a bit more setup on our end)
  • Other languages (Groovy, Kotlin)

Look into organizing jib-maven-plugin and jib-core dependency.

Currently, jib-core needs to be published to the local Maven repo and jib-maven-plugin imports jib-core as a dependency. This can be restructured such that jib-maven-plugin can directly use the jib-core classes.

Possible solution:

  • Add root project pom that has jib-core and jib-maven-plugin as dependencies
  • It can run the Gradle build for jib-core.

build failure on windows

Description of the issue:
error after running jib:build with no gcr cred helper installed
Expected behavior:
a helpful message explaining I didn't have cred helper configured properly
Steps to reproduce:
checkout https://github.com/patflynn/kplay/tree/jib-based
run mvn jib:build
Environment:
C:\Users\patrick\Projects\kplay\spring-boot-basic>mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: C:\Users\patrick\Tools\apache-maven-3.3.9\bin..
Java version: 9.0.1, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-9.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

jib-maven-plugin Configuration:

PASTE YOUR pom.xml CONFIGURATION HERE

Log output:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.129 s
[INFO] Finished at: 2018-02-07T15:50:53-05:00
[INFO] Final Memory: 23M/78M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.1.0:build (default-cli) on project demo-app: Execution default-cli of goal com.google.cloud.tools:jib-maven-plugin:0.1.0:build failed: Illegal char <> at index 0: * -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.1.0:build (default-cli) on project demo-app: Execution default-cli of goal com.google.cloud.tools:jib-maven-plugin:0.1.0:build fail
ed: Illegal char <
> at index 0: *
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.google.cloud.tools:jib-maven-plugin:0.1.0:build failed: Illegal char <> at index 0: *
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.nio.file.InvalidPathException: Illegal char <
> at index 0: *
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.resolve(Path.java:402)
at com.google.cloud.tools.jib.builder.BuildImageSteps.getEntrypoint(BuildImageSteps.java:175)
at com.google.cloud.tools.jib.builder.BuildImageSteps.run(BuildImageSteps.java:127)
at com.google.cloud.tools.jib.maven.BuildImageMojo.buildImage(BuildImageMojo.java:157)
at com.google.cloud.tools.jib.maven.BuildImageMojo.execute(BuildImageMojo.java:142)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
[ERROR]

Additional Information:

Can't build basic hello-world example

Description of the issue:
Jib tells me the "source files for [the] application layer cannot be empty." But I have a main class and it has content.

Expected behavior:
It should build an image that dutifully echoes a hello world.

Steps to reproduce:

  1. Create new, blank Maven project from IntelliJ
  2. Add Guava so we have some dependencies
  3. Add Jib to your Maven config
  4. Write a minimal Java class that echoes something
  5. Run mvn clean package jib:build

Environment:
Maven:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"

IntelliJ:

IntelliJ IDEA 2018.1 EAP (Ultimate Edition)
Build #IU-181.3494.3, built on February 6, 2018
IntelliJ IDEA EAP User
Expiration date: March 8, 2018
JRE: 1.8.0_152-release-1136-b5 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.3

jib-maven-plugin Configuration:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.sample</groupId>
    <artifactId>java-sample</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <app.version>v1</app.version>
        <app.project>some-project/app.project>
        <app.repository>java-sample</app.repository>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>24.0-jre</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>0.1.0</version>
                <configuration>
                    <registry>us.gcr.io</registry>
                    <repository>${app.project}/${app.repository}</repository>
                    <jvmFlags>
                        <jvmFlag>-Xms512m</jvmFlag>
                    </jvmFlags>
                    <mainClass>com.sample.Tool</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Sample main class:

package com.sample;

/**
 * Sample runner.
 */
public final class Tool {
  public static void main(String[] args) {
    System.out.println("Would do container stuff now.");
  }
}

Log output:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building java-sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ platform ---
[INFO] Deleting /<redacted>/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ platform ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ platform ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /<redacted>/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ platform ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /<redacted>/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ platform ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ platform ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ platform ---
[INFO] Building jar: /<redacted>/target/java-sample-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- jib-maven-plugin:0.1.0:build (default-cli) @ platform ---
[INFO] 
[INFO] Containerizing application with the following files:
[INFO] 
[INFO] 	Dependencies:
[INFO] 
[INFO] 		/<redacted>/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
[INFO] 		/<redacted>/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar
[INFO] 		/<redacted>/.m2/repository/com/google/guava/guava/24.0-jre/guava-24.0-jre.jar
[INFO] 		/<redacted>/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[INFO] 		/<redacted>/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar
[INFO] 		/<redacted>/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
[INFO] 	Resources:
[INFO] 
[INFO] 	Classes:
[INFO] 
[INFO] 		/<redacted>/target/classes/com
[INFO] 
[INFO] 
[INFO] Pushing image as us.gcr.io/<project>/java-sample:latest
[INFO] 
[INFO] RUNNING	Building and pushing image
[INFO] RUNNING	Authenticating with base image registry
[INFO] RUNNING	Authenticating with us.gcr.io using docker-credential-null
[INFO] Authenticating with us.gcr.io using docker-credential-null : 0.07 ms
[INFO] RUNNING	Building application layers
[INFO] RUNNING	Building dependencies layer
[INFO] RUNNING	Building resources layer
[INFO] Building application layers : 3.126 ms
[INFO] RUNNING	Building classes layer
[INFO] RUNNING	Setting up to push layers
[INFO] Setting up to push layers : 2.143 ms
[INFO] Building resources layer : 43.861 ms
[INFO] Building classes layer : 45.293 ms
[INFO] RUNNING	Pushing BLOB sha256:fe5c85e3330d1512c783e0caa2ae1efe2146847afe9a87b157a64f84b2ea7590
[INFO] Building dependencies layer : 342.431 ms
[INFO] RUNNING	Pushing BLOB sha256:e7be02943e29ba3a38d4fb0b7edd3ad5079f41ab0af3f417c08907539b2ee701
[INFO] Pushing BLOB sha256:e7be02943e29ba3a38d4fb0b7edd3ad5079f41ab0af3f417c08907539b2ee701 : 923.678 ms
[INFO] Pushing BLOB sha256:fe5c85e3330d1512c783e0caa2ae1efe2146847afe9a87b157a64f84b2ea7590 : 1266.138 ms
[INFO] Authenticating with base image registry : 1398.364 ms
[INFO] RUNNING	Pulling base image manifest
[INFO] Pulling base image manifest : 840.153 ms
[INFO] RUNNING	Setting up base image caching
[INFO] RUNNING	Pulling base image layer sha256:69e0471bd59644ac9a3820d2ff305b15b1783f7af0c2654b4c7fb0b5df91823a
[INFO] RUNNING	Pulling base image layer sha256:bb8371eaf7266a8e470788b8c2c4f33ff2c466bf31ecffbb2ca1ecf2657cd10a
[INFO] Setting up base image caching : 2.982 ms
[INFO] RUNNING	Pulling base image layer sha256:a79ed59a6f9f53ce631200429907b31aee38484f24589be8b65fe66a583a51c2
[INFO] RUNNING	Setting up to push layers
[INFO] Setting up to push layers : 0.155 ms
[INFO] Pulling base image layer sha256:a79ed59a6f9f53ce631200429907b31aee38484f24589be8b65fe66a583a51c2 : 429.458 ms
[INFO] RUNNING	Pushing BLOB sha256:a79ed59a6f9f53ce631200429907b31aee38484f24589be8b65fe66a583a51c2
[INFO] Pushing BLOB sha256:a79ed59a6f9f53ce631200429907b31aee38484f24589be8b65fe66a583a51c2 : 519.656 ms
[INFO] Pulling base image layer sha256:bb8371eaf7266a8e470788b8c2c4f33ff2c466bf31ecffbb2ca1ecf2657cd10a : 1387.601 ms
[INFO] RUNNING	Pushing BLOB sha256:bb8371eaf7266a8e470788b8c2c4f33ff2c466bf31ecffbb2ca1ecf2657cd10a
[INFO] Pushing BLOB sha256:bb8371eaf7266a8e470788b8c2c4f33ff2c466bf31ecffbb2ca1ecf2657cd10a : 644.379 ms
[INFO] Pulling base image layer sha256:69e0471bd59644ac9a3820d2ff305b15b1783f7af0c2654b4c7fb0b5df91823a : 4992.586 ms
[INFO] RUNNING	Pushing BLOB sha256:69e0471bd59644ac9a3820d2ff305b15b1783f7af0c2654b4c7fb0b5df91823a
[INFO] Pushing BLOB sha256:69e0471bd59644ac9a3820d2ff305b15b1783f7af0c2654b4c7fb0b5df91823a : 418.564 ms
[INFO] RUNNING	Pushing new image
[INFO] Pushing new image : 0.335 ms
[INFO] Building and pushing image : 7706.113 ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.860 s
[INFO] Finished at: 2018-02-12T10:26:15-08:00
[INFO] Final Memory: 23M/371M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.1.0:build (default-cli) on project platform: Build image failed: Source files for application layer cannot be empty -> [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

Additional Information:

  • gcloud is logged in
  • gcloud config get-value project produces the correct project

Separate cache into two: base image layers and application layers.

This allows for base image layers cache to be shared between projects. Also, doing mvn clean would only clear the application layer cache.

  • Use $HOME/.jib-cache as the default base image layers cache directory (#133)
  • Use separate Caches caches for caching base image layers and application layers.
  • Don't split caches with jib-maven-plugin configuration flag useOnlyProjectCache (#134)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.