Closed bbros-dev closed 4 years ago
Are you sure your shell isn't expanding the wildcard itself? Can you try /bin/sh -c "cp -f /root/vmlinux-* /output"
as an alternative command, which should force the wildcard to be expanded by a shell within the container?
Great that works. In general I need to use busybox.
Not sure if it is intended behavior that everything has to go through a shell?
All commands have to be passed in like that?
If you enter a command on the command line, the shell is going to interpret it. There is nothing podman or any other tool can do about it. Bash sees the command first and interprets it before handing the arguments to the podman program. This is the way shells work.
@rhatdan. Point taken. My apologies for cutting corners in the original report: The original command I expected to work is:
$ podman run --authfile ${auth_file} \
--rm \
--volume ${orig_cwd}/launch/artifacts/firecracker/kernels:/output \
--entrypoint=busybox \
yelgeb/${oci_name}:${semver} \
'cp -f /root/vmlinux-* /output'
: applet not found
Then by trial and error I got to a point where podman at least fed busybox a command busybox understood - the report I opened.
My understanding is that podman currently handles the input for an entrypoint
such that you have to provide cp
in a way that the host's shell becomes involved. I'll spare you all the permutations of inputs I've tried.
I'm not sure, but I believe the above should work?
Apologies if I have overlooked something obvious.
By making cp -f ...
into one large argument by wrapping it with quotes, Busybox is interpreting it in its entirety as the command to invoke (as opposed to command + arguments). Adding sh -c
in front will make this work, as Busybox will invoke a shell to interpret the string, not treat it as a single command.
So podman run --entrypoint=busybox $IMG sh -c 'cp -f /root/vmlinux-* output/'
should work.
/kind bug
Description
ls /root
is respected that /root refers to the container.cp -f /root/vmlinux-* /output
not so.Steps to reproduce the issue:
1. File list shows the file is there:
The copy command is looking in the host
--entrypoint
flag and use the commandbusybox ...
,Describe the results you received:
cp: can't stat '/root/vmlinux-*': No such file or directory
Describe the results you expected:
Copy completed.
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.):
Physical.