Skip to content
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 mounting host file as a data volume no longer works #930

Closed
RobertBoothby opened this issue Jul 17, 2017 · 5 comments
Closed

Docker mounting host file as a data volume no longer works #930

RobertBoothby opened this issue Jul 17, 2017 · 5 comments

Comments

@RobertBoothby
Copy link

Expected behavior

Per the documentation I expect to be able to mount a single host file to my docker image. This did work on previous versions.

Actual behavior

When I try to mount the host file it mounts it as an empty directory if the file does not exist in the image. This is happening to me and my colleagues running Docker for Windows, not for my colleagues running Docker for Linux and Mac.

Information

  • Diagnostic ID from "Diagnose & Feedback" in the menu.
    8C7ABEFB-E678-403F-AAC1-20921A20F512/2017-07-17_11-45-02
  • a reproducible case if this is a bug, Dockerfiles FTW
  • page URL if this is a docs issue or the name of a man page
    documentation
  • host distribution and version (Windows version, build number, etc)
    OS Name Microsoft Windows 10 Pro
    Version 10.0.15063 Build 15063

Steps to reproduce the behavior

  1. Create a temporary text file in the local host system (e.g. tmp.txt) with some content.
  2. Run a temporary bash image using "docker run --rm -it -v .\tmp.txt:/tmp.txt bash bash" launching the image's bash.
  3. Run "ls -altr" within the image and see that tmp.txt has been created as an empty directory and not the local file.
@jasonbivins
Copy link

Hi @RobertBoothby It looks like there's a syntax issue in the path you're using.
I can reproduce the issue using your command - but using this one it seems to work without issue. Let me know if you have issues with it

docker run --rm -ti -v c:/Users/desktop.ini:/foo alpine sh

@jamieshiz
Copy link

@jasonbivins - I am having a similar issue using docker-compose. See issue here: docker/compose#5037

@RobertBoothby
Copy link
Author

Thanks Jason. Sorry about the delay in replying. That gives us a work-around but it does highlight a change in behaviour and a divergence from the documentation referenced.

On Windows, mount directories using:

docker run -v c:<path>:c:<container path>

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants