Closed adelton closed 3 years ago
The reason I only create the container but not run it is that in real use-case, the image serves only as a distribution mechanism for the data to be used as volume and there are no binaries on it to run. The end goal of this exercise is to then copy the data from the volume to real directory on the host, with something like
docker run --volumes-from container-with-volume-populated-at-data -v /path/we-want-the-data-here:/data-out:z --rm busybox sh -c 'cd /data && cp -a . /data-out'
I also looked at skopeo but it only seems to manipulate the whole images, and the task of exploding the layers would need to be done manually.
This is one place where I don't know if we can copy Docker. Our create
operation is very lightweight and deliberately does not mount the container (so we can't perform the copy-up during it). Changing this wouldn't be that hard but does have significant performance implications for commands like podman run
.
You should be able to do a podman init
and then podman container cleanup
on the container to force it to prepare the mounts by copying up into them - would that be sufficient?
Running podman init
I get
Error: container_linux.go:349: starting container process caused "exec: \"noop\": executable file not found in $PATH": OCI runtime command not found error
So for a container image which has no executable binary to run, that does not seem to do the trick.
Hm, damn - didn't expect it would do that check before starting the container.
On Fri, Oct 16, 2020, 10:27 Jan Pazdziora notifications@github.com wrote:
Running podman init I get
Error: container_linux.go:349: starting container process caused "exec: \"noop\": executable file not found in $PATH": OCI runtime command not found error
So for a container image which has no executable binary to run, that does not seem to do the trick.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/containers/podman/issues/8041#issuecomment-710080732, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3AOCEXATHVIWI7VBRU7X3SLBJ4LANCNFSM4STBWIJA .
podman init
does error but the volume got the files from the container:
$ ll /home/paul/.local/share/containers/storage/volumes/test-copy-up/_data
total 28
-rw-r--r--. 1 paul paul 728 Jun 4 16:59 fedora-cisco-openh264.repo
-rw-r--r--. 1 paul paul 1303 Jun 4 16:59 fedora-modular.repo
-rw-r--r--. 1 paul paul 1349 Jun 4 16:59 fedora-updates-modular.repo
-rw-r--r--. 1 paul paul 1391 Jun 4 16:59 fedora-updates-testing-modular.repo
-rw-r--r--. 1 paul paul 1344 Jun 4 16:59 fedora-updates-testing.repo
-rw-r--r--. 1 paul paul 1286 Jun 4 16:59 fedora-updates.repo
-rw-r--r--. 1 paul paul 1239 Jun 4 16:59 fedora.repo
Ah, you are right. Running podman init
and ignoring the exit status 125 indeed does what I need.
A friendly reminder that this issue had no activity for 30 days.
@adelton Can we close this issue, since you have a work around?
Yes. Thank you.
Closing, thanks for the confirmation @adelton
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When volume and container with this volume are created by docker, that volume gets populated (copied up from the image) and can then be consumed by another container using
--volumes-from
. It does not seem to work with podman, in spite of https://github.com/containers/podman/issues/3945 having been resolved via https://github.com/containers/podman/pull/3961.Steps to reproduce the issue:
podman volume create test-copy-up
podman create --name test-copy -v test-copy-up:/etc/yum.repos.d registry.fedoraproject.org/fedora noop
podman run --rm --volumes-from test-copy docker.io/library/busybox ls -la /etc/yum.repos.d
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
I get the same results both with rootless podman and under
sudo podman
.The expected result is from the same commands, just replaced
podman
withdocker
, under moby-engine-19.03.11-1.ce.git42e35e6.fc32.x86_64.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
No
Additional environment details (AWS, VirtualBox, physical, etc.):
This is on physical Fedora 32 machine.