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

Document the accepted inputs when configuring tags on spring-boot:build-image and bootBuildImage #33088

Closed
VitaliyKulikov opened this issue Nov 9, 2022 · 1 comment
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@VitaliyKulikov
Copy link

VitaliyKulikov commented Nov 9, 2022

  • gradle plugin version: id("org.springframework.boot") version "2.7.5"
  • dsl: kotlin
  • snippet:
tasks.bootBuildImage {
  imageName = "sample"
  tags = listOf("tag1", "tag2")
}
  • command: gradle bootBuildImage
  • actual:
Successfully built image 'docker.io/library/sample:latest'
Successfully created image tag 'docker.io/library/tag1'
Successfully created image tag 'docker.io/library/tag2'
  • expected:
Successfully built image 'docker.io/library/sample:latest'
Successfully created image tag 'docker.io/library/sample:tag1'
Successfully created image tag 'docker.io/library/sample:tag2'
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 9, 2022
@wilkinsona
Copy link
Member

wilkinsona commented Nov 9, 2022

We know from #33002 that we have some users who expect the current behaviour. They have configured their tags like this:

bootBuildImage {
	imageName = "eu.gcr.io/company/imagename"
	builder = "paketobuildpacks/builder:tiny"
	if (System.getenv("IMAGE_TAGS")) {
		tags = (System.getenv("IMAGE_TAGS").split(",") as List<String>).collect { "$imageName:$it" }
	}
}

If we change it to work as shown in the expected output above, this configuration snippet would no longer work.

We're also aligned with the pack CLI which describes its --tag option thus:

  -t, --tag strings                 Additional tags to push the output image to.
                                    Tags should be in the format 'image:tag' or 'repository/image:tag'.
                                    Repeat for each tag in order, or supply once by comma-separated list

In our implementation, each tag becomes an ImageReference which means that things are a little more flexible due to its implementation:

Create a new ImageReference from the given value. The following value forms can be used:

  • name (maps to docker.io/library/name)
  • domain/name
  • domain:port/name
  • domain:port/name:tag
  • domain:port/name@digest

I think we should update the Maven and Gradle plugin documentation to describe the behavior of tags in more detail.

@wilkinsona wilkinsona changed the title Misleading behaviour bootImageBuild for option tags Document the accepted inputs when configuring tags on spring-boot:build-image and bootBuildImage Nov 9, 2022
@scottfrederick scottfrederick added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 9, 2022
@scottfrederick scottfrederick added this to the 2.6.x milestone Nov 9, 2022
@wilkinsona wilkinsona modified the milestones: 2.6.x, 2.7.x Nov 24, 2022
@philwebb philwebb modified the milestones: 2.7.x, 3.1.x Nov 8, 2023
@mhalbritter mhalbritter self-assigned this Nov 14, 2023
@mhalbritter mhalbritter modified the milestones: 3.1.x, 3.1.6 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

6 participants