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

Cannot bind mount a file that already exists in the container #5

Closed
matevarga opened this issue Jul 29, 2016 · 13 comments
Closed

Cannot bind mount a file that already exists in the container #5

matevarga opened this issue Jul 29, 2016 · 13 comments

Comments

@matevarga
Copy link

C:\Users\m\src\phr\docker\local [develop ≡]> docker run -it -v C:\Users\m\src\phr\docker\local\broker-config.yml:/cryptoservice/broker-config.yml image-name bash

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: oci runtime error: rootfs_linux.go:53: mounting "/var/lib/docker/aufs/mn t/90d24356afdeb7b9ddad4b3b6903be92063151c33bf34f3d63ede464437060c6/cryptoservice/broker-config.yml" to rootfs "/var/lib/docker/aufs/mnt/90d24356afdeb7b9ddad4 b3b6903be92063151c33bf34f3d63ede464437060c6" caused "not a directory".

Expected behavior

Similarly to how Docker behaves on Linux, the container should start.

Actual behavior

See above

Information

This happens on Win10 latest (1511?) + Docker 1.12, and with Mac as well (can't provide version for now).
I'll try to make an image with which this is reproducible.

@Reanmachine
Copy link

Reanmachine commented Aug 3, 2016

Having this issue myself:

ERROR: for balance-server  Cannot start service balance-server: 
oci runtime error: rootfs_linux.go:53: mounting
  "/var/lib/docker/aufs/mnt/148ee28f5388813cad2c9573d86884622802447e8f5c0b04eba36ce38fed3bf7/opt/balance/package.json" 
to rootfs
  "/var/lib/docker/aufs/mnt/148ee28f5388813cad2c9573d86884622802447e8f5c0b04eba36ce38fed3bf7" 
caused "not a directory"

Docker:

> docker version
Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:15:28 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:15:28 2016
 OS/Arch:      linux/amd64

Docker Compose:

> docker-compose version
docker-compose version 1.8.0, build d988a55
docker-py version: 1.9.0
CPython version: 2.7.11
OpenSSL version: OpenSSL 1.0.2d 9 Jul 2015

Windows:

Windows Version

@oparoz
Copy link

oparoz commented Aug 28, 2016

Same problem here when using compose.

It fails to mount those files

    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./config.php:/var/www/html/config/config.php

Tried both with stable and beta24.

@maltyxx
Copy link

maltyxx commented Sep 5, 2016

+1 me too

@friism
Copy link

friism commented Sep 8, 2016

Hm, this works for me:

C:\tmp> cat .\test.txt
hello
C:\tmp> docker run --rm -v c:/tmp/test.txt:/data/test-foo.txt alpine cat /data/test-foo.txt
hello
C:\tmp>

Is this a compose-specific problem?

@dgageot
Copy link
Member

dgageot commented Sep 9, 2016

@oparoz @maltyxx @matevarga Could you please test with Beta25 that was released two days ago. It contains some fixes related to file mounting. If you still have the issue, could you confirm:

  • That it works with docker cli like it works for @friism
  • It still fails with Compose. In which case a simple compose file to reproduce the issue would be nice.

@oparoz
Copy link

oparoz commented Sep 9, 2016

Here is an example which still doesn't work:
https://github.com/otbe/nc-docker-fpm/blob/master/example/docker-compose.yml

>docker --version
Docker version 1.12.1, build 23cf638, experimental
>docker-compose --version
docker-compose version 1.8.0, build d988a55

@oparoz
Copy link

oparoz commented Sep 9, 2016

And regarding the test

>cat .\test.txt
'cat' is not recognized as an internal or external command,
operable program or batch file.

Not sure if that's relevant, but I created the file manually and then

>docker run --rm -v test.txt:/data/test-foo.txt alpine cat /data/test-foo.txt
cat: read error: Is a directory
[15:58:13.883][ApiProxy       ][Info   ] Rewrote mount ./test.txt:/data/test-foo.txt (volumeDriver=) to test.txt:/data/test-foo.txt
[15:58:13.905][ApiProxy       ][Info   ] Failed to Walk to [snapshots 2e2f1dfbcaec1aa6b57bb05a7347b542c844fe0b ro com.docker.driver.amd64-linux proxy http] 9p: No such file or directory
[15:58:13.913][ApiProxy       ][Info   ] Failed to Walk to [snapshots 2e2f1dfbcaec1aa6b57bb05a7347b542c844fe0b ro com.docker.driver.amd64-linux proxy https] 9p: No such file or directory
[15:58:13.922][ApiProxy       ][Info   ] Failed to Walk to [snapshots 2e2f1dfbcaec1aa6b57bb05a7347b542c844fe0b ro com.docker.driver.amd64-linux proxy exclude] 9p: No such file or directory

@oparoz
Copy link

oparoz commented Sep 16, 2016

Same problem on beta26

@gegana
Copy link

gegana commented Sep 24, 2016

Same problem here

`version: '2'
services:
    helloworld-service:
        container_name: helloworldapp
        build: .

    reverse-proxy:
        container_name: reverse-proxy
        image: nginx
        ports:
         - "9090:8080"
        volumes:
         - ./nginx.conf:/etc/nginx/nginx.conf:ro`

this also did not work for me

C:\tmp> cat .\test.txt
hello
C:\tmp> docker run --rm -v c:/tmp/test.txt:/data/test-foo.txt alpine cat /data/test-foo.txt
hello
C:\tmp>

cat: read error: Is a directory

@oparoz
Copy link

oparoz commented Oct 2, 2016

Apparently fixed on beta27

@dgageot
Copy link
Member

dgageot commented Oct 4, 2016

Hi everyone, is it fixed for all of you with Beta27?

I'm going to tag the ticket as "will be closed" and will close it in a week of so if nobody complains :-) Thanks again for your reports!

@dgageot
Copy link
Member

dgageot commented Oct 10, 2016

Hi, I'm closing the issue has said a week ago. Feel free to reopen if the issue is still there, of course!

@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 16, 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

8 participants