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
Relative paths no longer accepted as bind mounts #19126
Comments
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead. If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information. For more information about reporting issues, see CONTRIBUTING.md. You don't have to include this information if this is a feature request (This is an automated, informational response) BUG REPORT INFORMATIONUse the commands below to provide key information from your environment:
Provide additional environment details (AWS, VirtualBox, physical, etc.): List the steps to reproduce the issue: Describe the results you received: Describe the results you expected: Provide additional info you think is important: ----------END REPORT --------- #ENEEDMOREINFO |
From the dockervolumes page :
It has been this way for a long time I think. It was already the case in June for example (so it was the 1.6 or 1.7). The example you gave is from |
But I'm talking about the host-dir bit. I'm saying that if the host-dir is not absolute, it is treated as a volume name instead. But I really want to use a relative host-dir. |
I'm on Docker 1.9.1:
This is running on the physical machine, no VMs.
List the steps to reproduce the issue:
It seems that since #16433 (specifically since @a7e686a779523100a092acb2683b849126953931), relative paths are rejected as bind mounts (see ParseVolumeSource in volume/volume_unix.go:127). Only absolute paths are accepted, treating all other input as volume names. Thus, using a relative path (as described in many docs, both for Docker Engine and Docker Compose (actually in the very first example!)) is no longer possible and results in an error message.
I would suggest the following rule to resolve this issue: If the spec is a valid volume name (given the regex in utils.RestrictedVolumeNamePattern), use it as a volume name, and as a bind path otherwise. This effectively rejects names starting with a dot, tilde, or slash. Though a cleaner way would be to check if such a volume name exists (in reference to #16072).
The text was updated successfully, but these errors were encountered: