Description of the issue:
When skimming the Maven Plugin document, I had copied the configuration for binding jib:build goal to mvn package phase, only to see it error that I don't have access to whatever registry I've currently setup.
Expected behavior:
mvn package should only _package_ the Docker image to a local Docker daemon, and instead mvn deploy should _push_ (and build) it.
Environment: Mac, Maven
Proposed Solution: Update docs to show both
<executions>
<execution>
<id>dockerBuild</id>
<goals>
<goal>dockerBuild</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>build</id>
<goals>
<goal>build</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
Thanks for the feedback.
The package life cycle is just an example to explain how to bind one of our goals jib:build to this particular package life cycle, but I do agree deploy may read better in many cases. I think it will highly depend on your project setup and how the deploy life cycle should mean to you. For example, some people may want to have package mean to prepare the app in a containerized form and deploy mean to actually deploy the containerized image to a server. Maybe we could add some notes clarifying that package in the doc is just an example phase and you may wish to bind the goal to different life cycles.
Lastly, note that Jib works without Docker installed, which we believe is one of the main reasons people using Jib. It is one of the strengths of Jib, and in that sense, we don't really want to promote jib:dockerBuild heavily. We don't want to give the impression that Jib requires Docker.
add some notes clarifying that package in the doc is just an example phase and you may wish to bind the goal to different life cycles
Right, that's really all I'm asking here, because I felt like I skimmed the Maven plugin README, saw that snippet, and blindly pasted, expecting it to just "package" / containerize it.
Realistically, in a full lifecycle, one would probably want to do
|phase|goal|result|
|-|-|-|
|package|buildDockerTar|literally package the code, with no installation|
|install|buildDocker|install the image|
|deploy|jib|push the image|
And I got that Jib doesn't require Docker locally, just seems useful to have copyable snippets that explain more throughly the build options in the events of being somewhere between "Getting Started" (read: without a Registry credential) and "Offline"
Closing as this is up to reader interpretation, as mentioned.
Most helpful comment
Right, that's really all I'm asking here, because I felt like I skimmed the Maven plugin README, saw that snippet, and blindly pasted, expecting it to just "package" / containerize it.
Realistically, in a full lifecycle, one would probably want to do
|phase|goal|result|
|-|-|-|
|
package|buildDockerTar|literally package the code, with no installation||
install|buildDocker|install the image||
deploy|jib|push the image|And I got that Jib doesn't require Docker locally, just seems useful to have copyable snippets that explain more throughly the build options in the events of being somewhere between "Getting Started" (read: without a Registry credential) and "Offline"