-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 save --format=oci-archive fails to write to a pipe #7017
Comments
@QiWang19 PTAL |
This can work without using
|
@QiWang19
My goal is to copy a container without having to create and the delete a temporary file. For now I am using the following command instead as a workaround
|
@mtrmac is this a bug from containers/image? |
Yes, in a way. c/image resolves the input file path into an absolute no-symlinks path (so that it can use the path for (Go’s As an immediate workaround, using named pipes would probably work. But, ouch. |
I am not sure how this is related to this bug. This bug is specifically about writing to an unnamed pipe failing. In the command |
Yes this is about the output path. |
The relationship is that internally the code does not work with file descriptors, only with paths. So, Podman calls the code with |
So podman needs to be special cased to not do this if the path is /dev/stdout. |
Well, it’s already a Podman special case to say It’s almost tempting to allow the reference to carry a file descriptor. Yet, that breaks the concept of stateless reusable references pretty badly. |
Well I am willing to go with whatever you think is best. |
I’m very tempted to sing la la la and pretend this bug doesn’t exist :) A named pipe would probably be least disruptive, when taking into account both c/image and the Podman call stack. |
@mtrmac Can you help me with some details how to fix this with named pipe in podman and c/image? can I sing with you together :) 🎤 🎤 |
In the place that currently decides to use
(*) FIFO behavior WRT EOF is a bit non-obvious, this is based on |
Wasn't there a way to create a named pipe in the virtual address space. Something like opening a file @/tmp/fifo? |
How does |
By only looking at the code I didn't see it resolving the symlink of /dev/stdout when saving as docker-archive. |
There is an “abstract namespace” for AF_UNIX sockets, but those are explicitly not paths (start with NUL). |
Yes, by that time we have given up on signature policies based on path names. But the feature still exists in the OCI transport, which is older. |
|
podman save uses named pipe as output path, not directly using /dev/stdout. fix containers#7017 Signed-off-by: Qi Wang <[email protected]>
podman save uses named pipe as output path, not directly using /dev/stdout. fix containers#7017 Signed-off-by: Qi Wang <[email protected]> <MH: Corrected imports during cherry-pick> Signed-off-by: Matt Heon <[email protected]>
podman save uses named pipe as output path, not directly using /dev/stdout. fix containers#7017 Signed-off-by: Qi Wang <[email protected]> <MH: Corrected imports during cherry-pick> Signed-off-by: Matt Heon <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I wanted a quick and dirty way to copy an image from one computer to another. The manual for
podman save
says that it writes tostdout
by default and the manual forpodman load
says that it reads fromstdin
by default so I assumed that piping the output ofpodman save
to the destination via ssh would work, but podman save --format=oci-archive fails to write to a pipe.Steps to reproduce the issue:
C="$(buildah from scratch)"
buildah commit "$C" bug
podman save --format=oci-archive bug | cat >/dev/null
Describe the results you received:
Error: error getting OCI archive ImageReference for ("/dev/stdout", "localhost/bug"): lstat /proc/2102/fd/pipe:[34531]: no such file or directory
Describe the results you expected:
The image archive is written to stdout.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
QubesOS https://github.com/QubesOS
The text was updated successfully, but these errors were encountered: