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

Created a container but can’t see files in the Windows host folder #21535

Closed
julianonunes opened this Issue Mar 26, 2016 · 20 comments

Comments

Projects
None yet
6 participants
@julianonunes

julianonunes commented Mar 26, 2016

I've run the following command to create a container base on this image: https://hub.docker.com/_/rails/

$ docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new --skip-bundle webapp

The message says that the rails project has been created, however, I can't find where did the files go in the host machine. I mean, shouldn't they go to $PWD?


BUG REPORT INFORMATION

Output of docker version:

Docker version 1.10.3, build 20f81dd

Output of docker info:

Containers: 3
 Running: 0
 Paused: 0
 Stopped: 3
Images: 21
Server Version: 1.10.3
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 96
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
 Volume: local
 Network: bridge null host
Kernel Version: 4.1.19-boot2docker
Operating System: Boot2Docker 1.10.3 (TCL 6.4.1); master : 625117e - Thu Mar 10 22:09:02 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 996.1 MiB
Name: default
ID: PJB3:2HTS:GH4U:F4ZX:DYTC:DQBX:O5DE:BJK4:6XDX:XXML:ZQE5:KWRD
Debug mode (server): true
 File Descriptors: 10
 Goroutines: 21
 System Time: 2016-03-26T02:27:28.947779376Z
 EventsListeners: 0
 Init SHA1:
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/sda1/var/lib/docker
Labels:
 provider=virtualbox

Additional environment details (AWS, VirtualBox, physical, etc.):
Windows 10 x64

Steps to reproduce the issue:
1.
2. docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new --skip-bundle webapp
3.

Describe the results you received:
Container is created, however the local folder does not list the synced files

Describe the results you expected:
Local and container folders with the same files

Additional information you deem important (e.g. issue happens only occasionally):
Always happen

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Mar 26, 2016

Is the local folder inside C:\Users ? Because by default, only C:\Users is shared with the Virtual Machine that the daemon runs in. If any other directory is used, the daemon will create an empty directory inside the VM, and use that as a bind-mounted volume

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Mar 26, 2016

You may be interested in this blog post though; https://blog.docker.com/2016/03/docker-for-mac-windows-beta/

@julianonunes

This comment has been minimized.

julianonunes commented Mar 26, 2016

I tried both inside and outside the Users folder (C:\Users\MyUser\Documents\Docker\projName).

@carrete

This comment has been minimized.

carrete commented May 25, 2016

We're using Docker for Windows (beta) and docker run -v //Users/project://project produces an empty /project directory in the container.

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented May 25, 2016

For Docker for Windows, this section may be relevant; https://beta.docker.com/docs/windows/troubleshoot/#host-filesystem-sharing

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented May 25, 2016

@julianonunes a similar issue just came up in #22981 are you perhaps not using VirtualBox, but Hyper-V?

@julianonunes

This comment has been minimized.

julianonunes commented May 26, 2016

@thaJeztah I used to have Hyper-V installed, but it was disabled using different boot profiles (like this: http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx).

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented May 26, 2016

@julianonunes alright, so your docker daemon is running in a VirtualBox VM?

@julianonunes

This comment has been minimized.

julianonunes commented May 26, 2016

Exactly.

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented May 26, 2016

@julianonunes if you docker inspect the container that's started, does it should the correct paths for the mounted directories? Wondering if it's an issue with shell-expansion of $PWD or mingw trying to do "smart" things (also looking at #20517)

@caylorme

This comment has been minimized.

caylorme commented Jul 9, 2016

http://docker-saigon.github.io/post/Docker-Beta/ -- check out the Mounting Volumes section on this page

@laurencee

This comment has been minimized.

laurencee commented Oct 2, 2016

@julianonunes I'm not sure if you've done this already but this caught out my team mates and myself the first time so I'll leave this message for others (and probably my future self).

On windows you have to configure the drive to be shared before the files from the volume mount will actually work (settings -> shared drives -> tick c drive).

There needs to be a warning/error on the windows version of docker to tell the user that they've tried to setup a volume mount without sharing the underlying drive first as I have seen this catch out everyone of my teammates.

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Oct 10, 2016

I'm closing this issue, as we need more information; most likely this is a configuration issue, but let us know if you still have this issue @julianonunes

@thaJeztah thaJeztah closed this Oct 10, 2016

@nmarkey10

This comment has been minimized.

nmarkey10 commented Mar 7, 2017

Is there any way to mount the volume without sharing the drive? I've been scouring the internet for a workaround. I am trying to prepare for all use cases (for instance, the user doesn't have permission to share their drive). Is there a default shared folder where I can store temporary data? Or is there a command I can run on Windows' end that will share a specific folder. Every time I look for a workaround I end up reading a bunch of threads on other issues and not this one. Any help is greatly appreciated!!

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Mar 7, 2017

No, unfortunately that's the only way to have it working currently on Windows

@nmarkey10

This comment has been minimized.

nmarkey10 commented Mar 7, 2017

Ah shoot. Well, thanks for the quick response! I guess my search stops here. Time to rethink some things. Thanks again.

@laurencee

This comment has been minimized.

laurencee commented Mar 8, 2017

Well there should still be a change to show a warning or prompt to share the folder if that's required for mounting to work on windows for a better user experience.

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Mar 8, 2017

@laurencee could you open a feature request for that in the issue tracker for Docker for Windows? https://github.com/docker/for-win/issues

@laurencee

This comment has been minimized.

laurencee commented Mar 9, 2017

Done

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Mar 9, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment