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
docker run --mount creates a directory owned by root if directory is removed at a wrong time #37083
Comments
|
/cc @cpuguy83 |
|
Do we know if there's a plan for someone to look at this? |
|
I did look into this. There's definitely a race here with how bind mounts
are handled.
I held off fixing this until after some major refactoring was merged...
which it now is.
I'm currently on vacation.
…On Mon, Jun 11, 2018 at 10:14 AM agoulti ***@***.***> wrote:
Do we know if there's a plan for someone to look at this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#37083 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAwxZkdmNCb-ryifxMxJ_WJeolUPhtnQks5t7qV-gaJpZM4UB3Bq>
.
|
|
Great, thanks for a quick reply! |
|
Thanks for fixing this! Any ideas on which Docker version this might be included in? Thanks! |
|
Assuming it gets merged soon, it will be 18.06+1 (since 18.06 RC is already cut). |
Description
If a "docker run" is started using "--mount" and the mounted directory is removed at a certain point during the invocation, it will create a directory owned by root.
This seems a race condition, since the timing or directory removal matters
Steps to reproduce the issue:
The following script has a good chance of reproducing the issue. Changing the timing of "sleep 0.5" changes the possibility of problems.
Describe the results you received:
More often than not, this results in the following messages:
Describe the results you expected:
--mount is said not to create a directory if it doesn't exist.
I am creating bad running conditions, so I expect docker to fail.
However, I expect
/tmp/try/nnnto never be created.Additional information you deem important (e.g. issue happens only occasionally):
This is a race condition, so the results are not guaranteed.
On my machine I get a problem around half the time.
Changing "sleep 0.5" duration changes the behaviour, you might need to tune it to reproduce on another machine.
Too short and it correctly executes with:
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist.Too long and it correctly executes with:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/tmp/try/nnn\\\" to rootfs \\\"/usr/[...]merged\\\" at \\\"/test\\\" caused \\\"stat /tmp/try/nnn: no such file or directory\\\"\"": unknown.Output of
docker version:Output of
docker info:Additional environment details (AWS, VirtualBox, physical, etc.):
Desktop Linux machine
The text was updated successfully, but these errors were encountered: