The new build-image Maven goal can automatically create an OCI image. This goal does not require repackage to run: if a packaged archive is present, it will use it as the source. If it's not, the repackaged archive will be created on the fly while communicating with the docker daemon.

I am wondering if the use case of building an image couldn't be promoted a bit more. If you want to run this as part of package you have to add an execution. Adding a profile in the parent might help with that (i.e. mvn package -Pimage).

I also wonder if there are cases where you don't care at all about the repackaged jar and all you want as the output is the image in your local Docker registry.

Comment From: wilkinsona

We have decided against adding a profile to the parent. The risk of it clashing with a user's own profile is too high. This is a documentation problem. We'll address it in Boot's own reference docs. We can also add something to HELP.md on start.spring.io.