gliderlabs / docker-alpine

Alpine Linux Docker image. Win at minimalism!
http://gliderlabs.viewdocs.io/docker-alpine
BSD 2-Clause "Simplified" License
5.71k stars 529 forks source link

Volume mounting does not work properly on VBox (Windows) #203

Open DieterDePaepe opened 8 years ago

DieterDePaepe commented 8 years ago

I'm running docker on a Windows 7 x64 machine. Docker: Docker version 1.11.2, build b9f10c9 VirtualBox: 5.1.2

Working in a folder with a file Hello.txt, I start the Docker Quickstart terminal:

$ cat Hello.txt
Hello world, how are you?

I use the following command to start a docker image and check the file is present:

$ docker run --rm -it --volume=$(pwd):/folder alpine /bin/sh
/ # cd folder
/folder # cat Hello.txt
Hello world, how are you?/folder #

Now I change the file through windows (Notepad++) so it has the following content: Great! and try again in the docker:

/folder # cat Hello.txt
Hello /folder #

It gets even stranger when changing the file from within docker:

/folder # echo Strange! > Hello.txt
/folder # cat Hello.txt
Hello wor/folder #

Restarting the docker image doesn't have any effect (it still shows the incorrect file content), after restarting the VM and starting a new docker image, the correct content is shown. This made me think of a bug in VirtualBox, but in an ubuntu image, this problem does not occur: docker run --rm -it --volume=$(pwd):/folder ubuntu:14.04 /bin/sh (Though the sh seems to be of a different version there.)

agurinov commented 8 years ago

Hi! +1 the same problem docker 1.12.1 Virtualbox with mac os

I noticed an interesting thing: with alpine:3.1 image (which is scanned without vulnerabilities) this problem does not occur

But unfortunately the official repositories, such as nginx:stable-alpine, inherited FROM alpine:3.4 and there is a problem there

If you want to make an clean image to work - FROM alpine:3.1 should help

andyshinn commented 8 years ago

Seems related to https://www.virtualbox.org/ticket/9069. I can reproduce it locally. Can you confirm if running echo 1 | sudo tee /proc/sys/vm/drop_caches in the VM temporarily fixes it?

DieterDePaepe commented 8 years ago

Doing this does indeed solve the issue.

creack commented 7 years ago

This doesn't do the trick on OSX.

Volumes are working fine with other images like ubuntu.

Virtualbox 5.1.22-11, Docker 17.06.0-ce, alpine 3.6.