Skip to content

Commit

Permalink
Bump Jib to 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Jun 15, 2020
1 parent 42fb948 commit bfb8845
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bom/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<jzlib.version>1.1.1</jzlib.version>
<checker-qual.version>2.5.2</checker-qual.version>
<error-prone-annotations.version>2.2.0</error-prone-annotations.version>
<jib-core.version>0.13.1</jib-core.version>
<jib-core.version>0.15.0</jib-core.version>
<google-http-client.version>1.34.0</google-http-client.version>
<scram-client.version>2.1</scram-client.version>
<!-- Make sure to check compatibility between these 2 gRPC components before upgrade -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@

import org.jboss.logging.Logger;

import com.google.cloud.tools.jib.api.AbsoluteUnixPath;
import com.google.cloud.tools.jib.api.Containerizer;
import com.google.cloud.tools.jib.api.DockerDaemonImage;
import com.google.cloud.tools.jib.api.FilePermissions;
import com.google.cloud.tools.jib.api.ImageReference;
import com.google.cloud.tools.jib.api.InvalidImageReferenceException;
import com.google.cloud.tools.jib.api.JavaContainerBuilder;
Expand All @@ -30,6 +28,9 @@
import com.google.cloud.tools.jib.api.LayerConfiguration;
import com.google.cloud.tools.jib.api.LogEvent;
import com.google.cloud.tools.jib.api.RegistryImage;
import com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath;
import com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer;
import com.google.cloud.tools.jib.api.buildplan.FilePermissions;
import com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory;

import io.quarkus.bootstrap.util.ZipUtils;
Expand Down Expand Up @@ -231,9 +232,6 @@ private ImageReference getImageReference(ContainerImageConfig containerImageConf
return ImageReference.of(registry, repository, tag);
}

// TODO createContainerBuilderFromJar won't work with fast-jar so we are better off just using our own
// containerBuilder with the proper layering (lib -> boot-lib -> quarkus-run -> transformed-bytecode -> generated-bytecode -> app)

/**
* We don't use Jib's JavaContainerBuilder here because we need to support the custom fast-jar format
* We create the following layers (least likely to change to most likely to change):
Expand Down Expand Up @@ -326,7 +324,7 @@ private JibContainerBuilder createContainerBuilderFromNative(ContainerImageConfi
return Jib
.from(toRegistryImage(ImageReference.parse(jibConfig.baseNativeImage), containerImageConfig.username,
containerImageConfig.password))
.addLayer(LayerConfiguration.builder()
.addFileEntriesLayer(FileEntriesLayer.builder()
.addEntry(nativeImageBuildItem.getPath(), workDirInContainer.resolve(BINARY_NAME_IN_CONTAINER),
FilePermissions.fromOctalString("775"))
.build())
Expand Down

0 comments on commit bfb8845

Please sign in to comment.