Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring-boot-maven-plugin tags option, multiple issues #33528

Closed
DemianTinkiel opened this issue Dec 15, 2022 · 2 comments
Closed

spring-boot-maven-plugin tags option, multiple issues #33528

DemianTinkiel opened this issue Dec 15, 2022 · 2 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@DemianTinkiel
Copy link

when creating an image with spring-boot-maven-plugin I encountered the following issues:

  1. Does not accept uppercase for tags, this doesn't allow me to add ${project.version}. Yet this is the default behaviour if tags is not specified. However, specifying tags overrides the behaviour, does not add to it (which is what I interpreted by the documentation by "One or more additional tags to apply to the generated image".)
Execution artifacts-prepare of goal org.springframework.boot:spring-boot-maven-plugin:2.7.3:build-image failed: Unable to parse image reference "3.0.0-SNAPSHOT". Image reference must be in the form '[domainHost:port/][path/]name[:tag][@digest]', with 'path' and 'name' containing only [a-z0-9][.][_][-] -> [Help 1]

  1. Setting as latest generates 2 images - myRepo:8090/group/myproject:latest and latest:latest, both with the same hash
docker images | grep 757bb1ccd2ff
latest                              latest              757bb1ccd2ff   42 years ago    264MB
myRepo:8090/group/myproject         latest              757bb1ccd2ff   42 years ago    264MB

for issue 1, my pom is

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <version>2.7.3</version>
  <configuration>
    <docker>
      <publishRegistry>
        <url>${image.repo.url}</url>
        <username>${image.repo.user}</username>
        <password>${image.repo.pass}</password>
      </publishRegistry>
    </docker>
    <image>
      <name>${image.prefix}/${project.artifactId}</name>
      <tags>latest,${project.version}</tags>
    </image>
  </configuration>
  <executions>
    <execution>
      <id>artifacts-prepare</id>
      <goals>
        <goal>build-image</goal>
      </goals>
    </execution>
  </executions>
</plugin>

for issue 2 the pom is the same but with <tags>latest</tags>

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 15, 2022
@scottfrederick
Copy link
Contributor

The values provided to the tags option should be full image references in the form of [image name]:[tag] or [repository]/[image name]:[tag]. It was done this way to provide users control over the full image reference. The name tags was chosen to be consistent with the pack CLI, but it can be confusing.

We should clarify this in the Maven and Gradle plugin documentation.

@scottfrederick scottfrederick added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 15, 2022
@scottfrederick scottfrederick added this to the 2.7.x milestone Dec 15, 2022
@scottfrederick scottfrederick added the status: ideal-for-contribution An issue that a contributor can help us with label Dec 15, 2022
shekharAggarwal added a commit to shekharAggarwal/spring-boot that referenced this issue Dec 21, 2022
As mentioned in spring-projects#33528, I have updated the description of `tags`.
@scottfrederick
Copy link
Contributor

Closing in favor of #33609.

@scottfrederick scottfrederick closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2022
@scottfrederick scottfrederick added status: superseded An issue that has been superseded by another and removed type: documentation A documentation update status: ideal-for-contribution An issue that a contributor can help us with labels Dec 21, 2022
@scottfrederick scottfrederick removed this from the 2.7.x milestone Dec 21, 2022
shekharAggarwal added a commit to shekharAggarwal/spring-boot that referenced this issue Dec 22, 2022
As mentioned in spring-projects#33528, I have updated the description of the tags for the Gradle plugin documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants