Open alisonatwork opened 2 years ago
@n1hility PTAL
FYI still on my radar, just haven't gotten to it yet.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
Hello, I got there after troubleshooting an EACCES error during my container's build that only appeared with podman, turns out my script doesn't have the +x bit set when I use "COPY". Any update on this issue since the original post ? Is it intentionally kept this way ?
Hey team! I just wanted to mention that this is causing me some friction with the Ansible Builder project.
I'm a Windows user, which means I can't run Ansible Playbooks directly (without the WSL), so I'd really like to use Ansible Builder to create execution environments with Podman and run the resulting container images. This workflow means I don't have to jump between shells for different parts of the project, and building immutable images for executing playbooks would offer a lot of development and operational benefits.
I'm just starting to explore the Ansible Builder documentation, and right out of the gate, it doesn't work. Upon running ansible-builder build
on a near-empty Ansible project, I get a "permission error" when it tries to build the Containerfile
.
The issue is that the generated Containerfile
copies various scripts from the host, which it assumes will be executable, and throws an error when it turns out they're not. This may not be an issue on Linux, and it may not be an issue for Docker, but for Podman on Windows, it means that other projects like Ansible Builder aren't usable without some awkward workarounds.
In this particular case, there's also a fair argument to be made that the COPY
commands generated in the Containerfile
by the Ansible Builder project should be generated with a --chmod
flag setting to mitigate this issue. I'm happy to open an issue there too if that's the team's preference.
That said, setting the executable bit by default in Podman would alleviate this issue for me and complement the efforts other Red Hat-supported projects that implicitly depend on it.
Thank you so much, and please let me know if there is anything else I can share!
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I am not exactly sure if this is a bug or a feature request, but if the goal for Podman on Windows is to maintain reasonable compatibility with Docker Desktop, this is something that will need to be addressed.
Because Windows doesn't have file permissions that work the same way as on UNIX, by default Docker on Windows copies files into the container with default permissions 0755, i.e. rwx for owner. Podman seems to instead supply 0666 permissions, i.e. rw for all. This means that if an executable (usually a shell script) is copied into the container, it will not run when the container is built with Podman, unless the container explicitly chmods the script. This is perhaps good practice, but it's not always done, especially thanks to the Docker default.
Steps to reproduce the issue:
Describe the results you received:
This small project fails to build in Podman on Windows because copied files do not have the execute bit set.
Describe the results you expected:
I expect the execute bit to be set, so that Dockerfiles that work in Docker Desktop on Windows behave the same in Podman on Windows.
Additional information you deem important (e.g. issue happens only occasionally):
I can understand if it's not desirable to always set the execute bit on everything that gets copied from Windows. But perhaps there could be a setting that would allow the user to control what the default permissions should be when ADD or COPY is encountered, only on Windows. I think some users would prefer 0755, even if others still want 0666. (On UNIX-like operating systems, the permissions can just be maintained as-is.)
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
):N/A
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes (latest version available from winget repo - 4.1.1)
Additional environment details (AWS, VirtualBox, physical, etc.):
Windows 11, version 22H2 build 22621.382