-
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
Container does not create source directory on the host for Binds #9510
Comments
@linggao Could you explain why you would want this feature. My argument against it at least from the podman client side, it is enables users to accidentally create unintended directories, when they have a typo in their command. I don't believe people would expect mount -o bind /tmp/testdata3 /tmp/data3 To automatically create /tmp/testdata3 directory, which is why i don't want podman do do it either. podman -v /tmp/testdata3:/tmp/data3 ... |
@rhatdan At the risk of sounding overly pejorative, when it comes to the compatibility API, if docker supports it then your API should too. I think that has to be a foundation principle for supporting the API. I do expect there will be cases where a reasonable exception can be made (I can cite an example if you want it). But, I don't think this is one of them. Docker seems to have already decided (based on how the API behaves) that this scenario is not a user error. I agree that if the behavior of the API were being designed right now, we could argue for your behavior, and I might even agree with you. But that's all a mute point now. |
Ok I will succumb for the Docker Compatibility API. Bug for Bug compatibility. |
It took a lot to figure out exactly how this should work, but I think I finally have it. My initial versions of this created the directory with the same owner as the user the container was run with, which was rather complicated - but after review against Docker, I have determined that is incorrect, and it's always made as root:root 0755 (Ubuntu's Docker, which I was using to try and test, is a snap - and as such it was sandboxed, and not actually placing directories it made in a place I could find?). This makes things much easier, since I just need to parse out source directories for binds and ensure they exist. Fixes containers#9510 Signed-off-by: Matthew Heon <[email protected]>
I don't know if this was ever working, but I have tested this on 4.4.1 and 4.5.1, and it does not work as expected. I get this:
Can we reopen this? |
Podman is not using the docker compatibility layer. You need to use something like docker-py or docker-compose to use compat. |
(duplicate of #6234) |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When starting a container using the docker compatible REST APIs, error occurred complaining that the source directory does not exist for the Binds specified in the HostConfig.
If running the same script on a docker engine, docker automatically creates the source directory if it does not exists.
Steps to reproduce the issue:
Describe the results you received:
creating container test...
{"cause":"statfs /tmp/testdata3: no such file or directory","message":"container create: statfs /tmp/testdata3: no such file or directory","response":500}
500
Describe the results you expected:
Directory /tmp/testdata3 should be automatically created on the host.
Additional information you deem important (e.g. issue happens only occasionally):
Command
podman run --name test1 -v /tmp/mydata:/tmp/data -d alpine sleep 1000
gives the same errorOutput 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?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: