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

buildah tag ruins manifest lists #3467

Closed
cevich opened this issue Aug 19, 2021 · 14 comments · Fixed by #3483
Closed

buildah tag ruins manifest lists #3467

cevich opened this issue Aug 19, 2021 · 14 comments · Fixed by #3483

Comments

@cevich
Copy link
Member

cevich commented Aug 19, 2021

Description

When I build a multi-arch manifest list, sometimes I want to call or push it using multiple names. Intuitively, the tag subcommand strikes me as the one to use, but doesn't seem to do the right thing.

Steps to reproduce the issue:

  1. $ buildah bud --layers --force-rm --jobs 12 --platform=linux/amd64 --manifest localhost/foo/bar:latest /path/to/context
  2. $ buildah tag localhost/foo/bar:latest localhost/foo/bar:9.8.7-testing
  3. $ buildah images

Describe the results you received:

REPOSITORY                                  TAG             IMAGE ID       CREATED         SIZE
localhost/foo/bar                           latest          e2c1204b1afd   7 minutes ago   547 B
localhost/foo/bar                           9.8.7-testing   e62f975862e7   7 minutes ago   119 MB

Describe the results you expected:

REPOSITORY                                  TAG             IMAGE ID       CREATED         SIZE
localhost/foo/bar                           latest          e2c1204b1afd   7 minutes ago   547 B
localhost/foo/bar                           9.8.7-testing   e2c1204b1afd   7 minutes ago   547 B

Output of rpm -q buildah or apt list buildah:

N/A compiled from source 197b9a1

Output of buildah version:

Version:         1.23.0-dev
Go Version:      go1.15.14
Image Spec:      1.0.1-dev
Runtime Spec:    1.0.2-dev
CNI Spec:        0.4.0
libcni Version:  v0.8.1
image Version:   5.15.1
Git Commit:      197b9a1f
Built:           Thu Aug 19 14:14:58 2021
OS/Arch:         linux/amd64
BuildPlatform:   linux/amd64

Output of podman version if reporting a podman build issue:

N/A

Output of cat /etc/*release:

NAME=Fedora
VERSION="33 (Workstation Edition)"
ID=fedora
VERSION_ID=33
VERSION_CODENAME=""
PLATFORM_ID="platform:f33"
PRETTY_NAME="Fedora 33 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:33"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f33/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=33
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=33
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Output of uname -a:

Linux fedora 5.12.17-200.fc33.x86_64 #1 SMP Thu Jul 15 12:41:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of cat /etc/containers/storage.conf:

Default that comes from installing rpms

@cevich
Copy link
Member Author

cevich commented Aug 19, 2021

Note: For my use-case, I would be perfectly happy using a buildah manifest tag subcommand if it were available. Regular users though, they might expect buildah tag to work, so maybe print a warning if the source is a manifest list?

@rhatdan
Copy link
Member

rhatdan commented Aug 24, 2021

@flouthoc PTAL

@flouthoc
Copy link
Collaborator

/assign

@flouthoc
Copy link
Collaborator

@cevich @rhatdan So afaik builah tag actually fetches the relevant image from the manifest list and tags it which seems to be the expected behavior since that is what manifest was supposed to do. I am in favor of buildah manifest tag but would love your opinions on this.

@rhatdan
Copy link
Member

rhatdan commented Aug 25, 2021

I am fine with manifest tag.

How does buildah tag figure out which image is relavent? IE If I have a list with multiple images, will it tag them all, or just the first one it finds.

@rhatdan
Copy link
Member

rhatdan commented Aug 25, 2021

Or the one that matches the current arch?

@flouthoc
Copy link
Collaborator

@rhatdan It takes image options if nothing is provided it gets arch value from runtime context i.e r.systemContext.ArchitectureChoice and creates image for particular architecture.

@flouthoc
Copy link
Collaborator

@cevich @rhatdan Going ahead with buildah manifest tag.

@nalind
Copy link
Member

nalind commented Aug 25, 2021

Are we going to come back and retrofit tag later, like we did with buildah push?

@flouthoc
Copy link
Collaborator

@nalind I missing context on retrofit about buildah push 😅 . Would love to hear what's your take on buildah manifest tag do you think its a good idea or should we have support for tagging manifest list in buildah tag itself.

@nalind
Copy link
Member

nalind commented Aug 25, 2021

The retrofit for buildah push was done in #2895, and the reasoning given for it and #2894 agrees with #3467 (comment). If we're going to reverse course and do the same thing here later, we might as get it over with now.

@flouthoc
Copy link
Collaborator

@nalind @rhatdan I was not aware of previous threads but i guess from what it seems I think i should move with buildah tag instead of buildah manifest tag inorder to prevent rework or retrofits. WDYT

@rhatdan
Copy link
Member

rhatdan commented Aug 25, 2021

I am fine with buildah tag == buildah manifest tag.

@flouthoc
Copy link
Collaborator

Following PR's should close this #3483 & containers/common#747

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants