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

podman .build quadlet ImageTag not equivalent to --tag with podman build #23781

Closed
kraftreich opened this issue Aug 28, 2024 · 4 comments · Fixed by #23810
Closed

podman .build quadlet ImageTag not equivalent to --tag with podman build #23781

kraftreich opened this issue Aug 28, 2024 · 4 comments · Fixed by #23810
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. quadlet

Comments

@kraftreich
Copy link

Issue Description

podman build with multiple --tag is supported. eg
podman build -t testimage:0.0.5 -t testimage:latest build/

a quadlet testimage.build with multiple ImageTag does not work, it takes the last ImageTag

[Build]
File=%h/build/Containerfile
ImageTag=testimage:0.0.5
ImageTag=testimage:latest
Label = testimage
SetWorkingDirectory=%h/build

[Service]
TimeoutStartSec=900

From the docs, --tag should be equivalent to ImageTag

ImageTag=
Specifies the name which is assigned to the resulting image if the build process completes successfully.

This is equivalent to the --tag option of podman build.

Steps to reproduce the issue

Steps to reproduce the issue
1.
2.
3.

Describe the results you received

Describe the results you received

Describe the results you expected

Describe the results you expected

podman info output

If you are unable to run podman info for any reason, please provide the podman version, operating system and its version and the architecture you are running.

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@kraftreich kraftreich added the kind/bug Categorizes issue or PR as related to a bug. label Aug 28, 2024
@kraftreich
Copy link
Author

version fedora 40

Client:       Podman Engine
Version:      5.2.1
API Version:  5.2.1
Go Version:   go1.22.5
Built:        Wed Aug 14 02:00:00 2024
OS/Arch:      linux/amd64

@Luap99 Luap99 added the quadlet label Aug 28, 2024
@ygalblum
Copy link
Contributor

Thanks for reporting this.

You are correct about the multiple tags. But, we need to clear another issue before we can add this support.

One of Quadlet's biggest advantages is the ability to reference one Quadlet unit from a different one. In the case of .build files they can be used as the value of the Image field for .container or .volume files. However, this requires Quadlet to know the name of the artifact produced by the .build file. Having a single tag allows just that. Multiple tags on the other hand do not.

As I see it, we have three options here:

  1. Leave the implementation as is and update the documentation
  2. Add a new Key that will be mandatory if multiple ImageTag keys are set to provide the name of the artifact
  3. Define which one of the instances of ImageTag (first or last) should be used as the artifact name.

I don't like option 2 as it will require a duplication and if it is incorrect the dependency breaks. So, the question is whether supporting multiple tags is required. If yes, then we need to define (and implement and document) if it is the first or last occurrence that is the name of the artifact.

@rhatdan
Copy link
Member

rhatdan commented Aug 29, 2024

I think I would prefer #3 with ImageTag being first.

@ygalblum
Copy link
Contributor

I've opened a PR with the change following @rhatdan's preference.

@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 29, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Nov 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. quadlet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@kraftreich @rhatdan @ygalblum @Luap99 and others