LewlSauce
LewlSauce

Reputation: 5882

Mounted a volume in Docker, but container and localhost changes are independent

I think I may either be experiencing an error, or misunderstanding the way volumes work in Docker containers.

I am starting my image using the following command: docker run --name Goku -ti -p 3000:3000 -v VSPM:/root/goku:rw ubuntu:goku

VSPM is the local directory and I am wanting to mount it to /root/goku on the docker container. Well, it mounts just fine; however, if I create a new file within the container, that new file doesn't show on the localhost in the VSPM directory. The same vice versa -- if I create a new file on the host in that folder, nothing changes in the container's folder.

What am I doing wrong? I just simply want a shared folder between the host and the container. Nothing more, nothing less.

Upvotes: 0

Views: 221

Answers (1)

Wil
Wil

Reputation: 3188

Use the full file path of the local mounted drive instead of just VSPM.

Upvotes: 1

Related Questions