Closed Limpan closed 4 months ago
Please run podman machine ssh
and then install strace and then podman under strace strace -f - o log podman run ...
The log file should tell us more what exactly is missing.
Ran strace -f -o log.txt podman run --rm data_aggregator:latest
from within the podman machine and got the following output and strace.log.
WARN[0000] Using cgroups-v1 which is deprecated in favor of cgroups-v2 with Podman v5 and will be removed in a future version. Set environment variable `PODMAN_IGNORE_CGROUPSV1_WARNING` to hide this warning.
{"msg":"exec container process (missing dynamic library?) `/app/entrypoint.sh`: No such file or directory","level":"error","time":"2024-06-17T11:03:51.653143Z"}
strange, your reproducer works fine for me on linux as well. The strace doesn't show us much more either other than it cannot find /app/entrypoint.sh
which the error already shows.
Do you store you files with windows line endings? I think it is possible that you entrypoint file has CR+LF windows line endings instead of LF linux line endings, as such the shebang which is execute when the script is loaded is not the normal /bin/sh
but rather /bin/sh\r
which of course does not exists.
No carriage returns in entrypoint.sh
, only line feed.
Did you run something like cat -e /app/entrypoint.sh
in the container to confirm? As I said it works fine on linux so I don't really see another explanation and when I changed the file to CR+LF it failed exactly in the way it does for you.
Interesting. I think I understand what is happening. I did the check in my linux vm and there I have LF endings but the container I built from Windows I have CR+LF endings.
C:\Users\torlv>podman run --rm -it --entrypoint "" data_aggregator:latest /bin/sh -c "cat -e /app/entrypoint.sh"
#!/bin/sh^M$
^M$
set -e^M$
^M$
# Activate virtual environment^M$
. /app/.venv/bin/activate^M$
^M$
# Run passed command^M$
exec "$@"^M$
The reason seems to be the autocrlf feature of git. It changed line endings and then the shebang of my entrypoint script broke.
C:\Users\torlv>git config core.autocrlf
true
Turning off gits autocrlf so called feature with git config --global core.autocrlf false
, cloning the repo again and building it works as expected.
Thank you for your time! Sorry that the issue wasn't related to podman.
Issue Description
The following error is thrown when trying to start container.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
The container would not start.
Describe the results you expected
Expected the container to start.
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
Using Podman Desktop on Windows 10 Enterprise, 22H2.
Additional information