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

host mounted volumes don't work on Windows #23005

Closed
rebeccamadsen opened this Issue May 26, 2016 · 5 comments

Comments

Projects
None yet
6 participants
@rebeccamadsen

rebeccamadsen commented May 26, 2016

Output of docker version:

Client:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:20 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   8b63c77
 Built:        Mon May 23 20:50:37 2016
 OS/Arch:      linux/amd64

Output of docker info:

Client:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:20 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   8b63c77
 Built:        Mon May 23 20:50:37 2016
 OS/Arch:      linux/amd64
PS C:\Users\Big Baloo> docker info
Containers: 41
 Running: 0
 Paused: 0
 Stopped: 41
Images: 33
Server Version: 1.11.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 103
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge null
Kernel Version: 4.4.11-moby
Operating System: Alpine Linux v3.3
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.951 GiB
Name: moby
ID: MK4S:PIEE:NZ2H:S26M:G2AL:36AB:ZLNO:TJ6O:AESB:N3B5:YHQ6:UBRM
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/

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

Steps to reproduce the issue:

  1. My makefile looks like this:
    `.PHONY = all build check-coverage check-login-variables-defined clean cljs-build cljs-test coverage create-volume deps emacs figwheel lint login push repl scss-build scss-lint scss-watch serve shell test update-dependencies watch

CONTAINER = lynxtp/ui-toolkit
VOLUME = ui-toolkit-volume

VERSION = $(shell ./version.sh)
export VERSION

PORT = 3000
export PORT

all: lint check-coverage cljs-test

is-defined-%:
@$(if $(value $),,$(error The environment variable $ is undefined))

create-volume:
@docker volume create --name $(VOLUME)

build: create-volume
@docker build --pull --build-arg PORT=$(PORT) -t $(CONTAINER):$(VERSION) .

cljs-build cljs-test deps lint repl scss-build scss-lint serve test: build
@docker run -p $(PORT) -v $(VOLUME)://var/cache -v $(VOLUME)://srv/lein -v $(VOLUME)://root/.m2
$(CONTAINER):$(VERSION) make $@

check-coverage clean coverage emacs figwheel scss-watch shell update-dependencies watch: build
@docker run -p $(PORT) -v $(VOLUME)://var/cache -v $(VOLUME)://srv/lein -v $(VOLUME)://root/.m2
-i -t -p 5309 -v //"$(shell pwd)"/app://opt/app
$(CONTAINER):$(VERSION) make $@

check-login-variables-defined: is-defined-DOCKER_HUB_USERNAME is-defined-DOCKER_HUB_PASSWORD is-defined-DOCKER_HUB_EMAIL

login: check-login-variables-defined
@docker login -u $(DOCKER_HUB_USERNAME) -p $(DOCKER_HUB_PASSWORD) -e $(DOCKER_HUB_EMAIL)

push: login
@docker push $(CONTAINER):$(VERSION)

ALL_PORTS = $(shell docker ps --format '{{.Ports}}' --filter 'label=service=ui-toolkit')
PORT_3000 = $(shell echo "$(ALL_PORTS)" | perl -ne '/:(\d+)->3000/; print $$1;')
PORT_5309 = $(shell echo "$(ALL_PORTS)" | perl -ne '/:(\d+)->5309/; print $$1;')
CONTAINER_IP = $(shell docker-machine ip default)

define SHOW_PORTS
Port 3000 is mapped to $(PORT_3000).
Port 5309 is mapped to $(PORT_5309).

Use http://$(CONTAINER_IP):$(PORT_3000) to connect to the web server.
endef

show-ports:
ifeq ($(ALL_PORTS), )
@$(info Sorry, the container does not appear to be running)
@true
else
@$(info $(SHOW_PORTS))
@true
endif
2. When I runmake -nI get this: docker volume create --name ui-toolkit-volume
docker build --pull --build-arg PORT=3000 -t lynxtp/ui-toolkit:add-buttons .
docker run -p 3000 -v ui-toolkit-volume://var/cache -v ui-toolkit-volume://srv/lein -v ui-toolkit-volume://root/.m2
lynxtp/ui-toolkit:add-buttons make lint
docker run -p 3000 -v ui-toolkit-volume://var/cache -v ui-toolkit-volume://srv/lein -v ui-toolkit-volume://root/.m2
-i -t -p 5309 -v //"/c/Users/ui-toolkit"/app://opt/app
lynxtp/ui-toolkit:add-buttons make check-coverage
docker run -p 3000 -v ui-toolkit-volume://var/cache -v ui-toolkit-volume://srv/lein -v ui-toolkit-volume://root/.m2
lynxtp/ui-toolkit:add-buttons make cljs-test 3. When I runmake`, I get the following results:

Describe the results you received:
ui-toolkit-volume Sending build context to Docker daemon 5.922 MB Step 1 : FROM lynxtp/lein:2.6.1 2.6.1: Pulling from lynxtp/lein 0be59000882d: Already exists f20b6f990572: Already exists 53662c966c9f: Already exists a3ed95caeb02: Already exists 51105afb44b4: Already exists ... Step 10 : COPY ./app/ /opt/app/ ---> Using cache ---> 7aabce2e0b10 Step 11 : WORKDIR /opt/app/ ---> Using cache ---> 6c2fd7ac170a Successfully built 6c2fd7ac170a SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and director ies added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions f or sensitive files and directories. src resources/public/ui-toolkit/scss resources/public/demo/scss test == Linting ui-toolkit.ring == == Linting ui-toolkit.ring-test == == Warnings: 0 (not including reflection warnings) Exceptions thrown: 0 make: *** No rule to make target 'check-coverage'. Stop. Makefile:28: recipe for target 'check-coverage' failed make: *** [check-coverage] Error 2

Describe the results you expected:
I expected make to mount and use my local directory.

Additional information you deem important (e.g. issue happens only occasionally):
Per #22981 (comment), I made sure to enable File and Printer sharing, but was unable to enable a shared drive through the Docker Beta Settings. Whenever I enter a username/password, the username/password dialog just pops up again. I have tried with my usual password, and a password with just letters.

@carrete

This comment has been minimized.

carrete commented May 26, 2016

To add some detail, the problem in the output above where we see make: *** No rule to make target 'check-coverage' is because this: -v //"/c/Users/ui-toolkit"/app://opt/app doesn't mount the host volume. /opt/app is empty thus the error from make because there is no Makefile. This worked on Windows with virtualbox prior to trying the beta that uses hyper-v.

@rebeccamadsen

This comment has been minimized.

rebeccamadsen commented May 26, 2016

As an update, after (a few) computer restart(s), I was finally able to share my c drive through the dialog in Docker Beta -> Settings. However, the problem of not mounting correctly persists. If I run the sample command in the Settings dialog in Powershell, docker run -v c:/Users:/data alpine ls /data, I can only see one of the four folders listed, and cannot see deeper than one level inside it. ls /data/myfolder only shows one folder of the many items it contains as well.

@friism

This comment has been minimized.

Contributor

friism commented May 26, 2016

@rebeccamadsen since this is a Docker for Windows issue, the best place to get help is probably on the Docker for Windows forums (that I think you already found): https://forums.docker.com/t/volume-mounts-in-windows-does-not-work/10693/

The host<->container volume mounting is not covered by docker/docker project.

@cpuguy83 cpuguy83 closed this May 26, 2016

@cpuguy83

This comment has been minimized.

Contributor

cpuguy83 commented May 26, 2016

@rebeccamadsen

This comment has been minimized.

rebeccamadsen commented May 26, 2016

Thanks, I'll take a look.

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