Skip to content

Instantly share code, notes, and snippets.

@Janderson
Last active May 29, 2019 18:09
Show Gist options
  • Select an option

  • Save Janderson/b14b4e29bad8358a0ee367650edbf3b9 to your computer and use it in GitHub Desktop.

Select an option

Save Janderson/b14b4e29bad8358a0ee367650edbf3b9 to your computer and use it in GitHub Desktop.
Docker share folder with windows using virtualbox
First using virtualbox interface, go to dockermachine usually it named as default, after that go to Shared Folders > Shared Folder Settings and share choose a folder into windows usually I choose my projects folder and choose a name [NameOfYourSharedFolder].
# create a volume into docker
docker volume create projects
# remove the old folder data
rmdir /mnt/sda1/var/lib/docker/volumes/projects/_data/
# create a mount point
sudo mount -t vboxsf -o uid=1000,gid=50 [NameOfYourSharedFolder] /mnt/sda1/var/lib/docker/volumes/projects/_data/
#Example of docker-compose.yml
version: "3.4"
services:
test:
build:
context: "."
dockerfile: "Dockerfile"
volumes:
- projects:/home/desenv/
volumes:
projects:
external: true
References:
http://support.divio.com/local-development/docker/how-to-use-a-directory-outside-cusers-with-docker-toolboxdocker-for-windows
@Janderson
Copy link
Author

After dealing with this stuff, I finally figure out how to share a folder with windows even inside a container

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