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 --output to an oci-archive isn't easy to figure out #4740

Closed
dustymabe opened this issue Apr 14, 2023 · 11 comments · Fixed by #5230
Closed

podman build --output to an oci-archive isn't easy to figure out #4740

dustymabe opened this issue Apr 14, 2023 · 11 comments · Fixed by #5230
Labels
kind/documentation Categorizes issue or PR as related to documentation. locked - please file new issue/PR

Comments

@dustymabe
Copy link

Description

I was looking for an easy way to build and output to an oci-archive in a single step. So rather than podman build -t + podman push foo oci-archive:./foo.ociarchive, I need to just do that in one step.

I discovered the --output option, which in the man page describes:

the value of --output can be just a destination (in the **dest** format)"

So I try:

podman build -f Containerfile --output=oci-archive:./foo.ociarchive

and that fails with an obscure error (I'm in a locked down environment):

+ podman build /srv/tmp/tmpw2r2ieuu --output oci-archive:/srv/builds/37.20230414.dev.0/x86_64/fedora-coreos-37.20230414.dev.0-kubevirt.x86_64.ociarchive     
STEP 1/2: FROM scratch                                                                                                                                       
STEP 2/2: ADD fedora-coreos-37.20230414.dev.0-kubevirt.x86_64.qcow2 /disks/                                                                                                                                                                                                                                                
COMMIT                                                                                                                                                       
Error: failed to export build output: failed while performing untar at "/srv/oci-archive:/srv/builds/37.20230414.dev.0/x86_64/fedora-coreos-37.20230414.dev.0-kubevirt.x86_64.ociarchive": processing tar file(lchown /disks: operation not permitted): exit status 1

What's important here is not the failure, but the fact that podman isn't doing what I'm asking for.

I also tried with --output type=oci,dest=./foo.ociarchive and that didn't work either.

Then @nalind told me that --tag supports destination format (undocumented) and that works:

+ podman build /srv/tmp/tmp5zrcblve --tag oci-archive:/srv/builds/37.20230414.dev.0/x86_64/fedora-coreos-37.20230414.dev.0-kubevirt.x86_64.ociarchive
STEP 1/2: FROM scratch
STEP 2/2: ADD fedora-coreos-37.20230414.dev.0-kubevirt.x86_64.qcow2 /disks/
COMMIT oci-archive:/srv/builds/37.20230414.dev.0/x86_64/fedora-coreos-37.20230414.dev.0-kubevirt.x86_64.ociarchive
--> 

+ exit 0

I think there's a few places where there is room for improvement here:

  1. Document that --tag supports destination format and not just tags. Is there a good reason not to?
  2. Add support for --output to output to destination format locations. Is there a good reason not to?
  3. Document the limitations of --output.

Output of rpm -q buildah or apt list buildah:

podman-4.4.4-3.fc37.x86_64
@nalind
Copy link
Member

nalind commented Apr 14, 2023

The dest format mentioned in the docs about --output is in the format of a dest value that would also be passed to --output. The doc for --output only mention local and tar as recognized types, as the set of type values isn't going to be the same as the set of transports enumerated in containers-transports(5).

@dustymabe
Copy link
Author

dustymabe commented Apr 14, 2023

Hmm. I guess I was confusing **dest** format in the docs with the formats specified in containers-transports(5). I didn't know there was another set of formats. Is there a place we could link to with more information on those formats?

It seems these different options/formats are competing. Should we spell it out in the docs?

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented May 15, 2023

@nalind @flouthoc thoughts?

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jun 20, 2023

@vrothberg @flouthoc @umohnani8 @nalind PTAL

@vrothberg
Copy link
Member

I support @dustymabe's proposal to make the docs clearer on this issue.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan rhatdan added kind/documentation Categorizes issue or PR as related to documentation. and removed stale-issue labels Jul 24, 2023
@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

A friendly reminder that this issue had no activity for 30 days.

Copy link

A friendly reminder that this issue had no activity for 30 days.

rhatdan added a commit to rhatdan/buildah that referenced this issue Dec 17, 2023
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/buildah that referenced this issue Dec 18, 2023
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/buildah that referenced this issue Dec 18, 2023
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/buildah that referenced this issue Dec 20, 2023
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/buildah that referenced this issue Dec 20, 2023
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/buildah that referenced this issue Feb 16, 2024
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/buildah that referenced this issue Feb 17, 2024
Fixes: containers#4740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/documentation Categorizes issue or PR as related to documentation. locked - please file new issue/PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants