question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider Jib packaging type

See original GitHub issue

We added a jib.skip property to deal with jib:build in a multi-module setup (#865 and #911). An alternative would be to create a custom jib packaging type that would incorporate one of our jib goals as part of the Maven lifecycle, and thus eliminate the need to explicitly invoke jib:*.

Creating a custom packaging is relatively straight-forward, and mapping to the maven-jar-plugin is pretty straightforward too. Except there’s a bit of a conflict in the default expectations of the package, install, and deploy lifecycle phases and effects of Jib build options: package is generally entirely local, install installs to local ~/.m2/repository, and deploy (upload somewhere). One possible mapping might be:

  • package: buildTar
  • install: dockerBuild ← load to the local docker daemon
  • deploy: build

Another possibility is to introduce new Jib goals for install and deploy that load the built-tar container into the local docker daemon or upload to a registry.

Or another alternative is to define a single new Jib goal used for package whose build action is determined by a property. Say jib:package which uses the jib.destination property that defines tar, daemon, or registry.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tandedaycommented, Aug 2, 2019

As the goals usually are exclusive (you don’t want a tar, deploy to local docker and a registry in the same build) I think it would be better to provide clear instructions on how to bind to the Maven build cycle.

A thing that may be easy to do, is to have “buildTar” generate the docker image as the build artifact, which can then be pushed to a maven registry and treated like any other artifact. This may be an interesting alternative to moving images around for existing Java pipelines.

0reactions
loosebazookacommented, Mar 10, 2020

I think we are going to shelve this for now. Users wanting to integrate into the maven lifecycle can do so in their pom, disable the deploy and install tasks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Buildpacks, Jib, or Dockerfile: Which method should you ...
Jib is a great option with Maven and Gradle builds for Container Images that use the JVM.
Read more >
Building Java container images using Jib - Snyk
Jib is an open source, 100% Java tool that builds OCI (Docker v2) compliant container images without a Dockerfile or even a container...
Read more >
jib-container - Garden documentation
Important note: Unlike many other module types, jib modules are built from the module source directory instead of the build staging directory, ...
Read more >
12 Types of Packaging Careers (Plus Salaries and Duties)
In this article, we discuss what packaging careers are, the main duties ... A packaging career is any job that involves packing, wrapping, ......
Read more >
Container Images - Quarkus
The extension quarkus-container-image-jib is powered by Jib for performing container image builds. The major benefit of using Jib with Quarkus is that all ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found