Reputation: 15008
I'm trying to build a Docker image for my Spring Boot service using mvn spring-boot:build-image
as mentioned in the guide here. It also mentions
The result is an image called docker.io//:latest by default. You can modify the image name in Maven using
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>my/preferred/name</name>
</image>
</configuration>
</plugin>
</plugins>
</build>
It seems pretty straightforward... however, this results in a Docker image with the name docker.io/my/preferred/name
.
How do I get rid of the docker.io
prefix?
Upvotes: 2
Views: 1198
Reputation: 14502
My guess is that you are confusing the parser with so many slashes (/
). Since there is no reasonable way to parse my/preferred/name
, it will be considered as just a name (as a whole) in which case the default docker.io/library/
will be prepended to it.
Here is how you can specify the name of the image in the name
tag.
Your my/preferred/name
name falls under the first category.
Upvotes: 2