Skip to content

Instantly share code, notes, and snippets.

@Gronghon
Last active January 19, 2016 21:26
Show Gist options
  • Save Gronghon/ab3f1f860ddb615e74ef to your computer and use it in GitHub Desktop.
Save Gronghon/ab3f1f860ddb615e74ef to your computer and use it in GitHub Desktop.
How to mount a shared folder on a docker machine (draft)
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
Host : Windows 10
VirtualBox : 5.0.10 r104061
Docker : 1.9.1
Docker machine : 0.5.5
1/ Create a docker machine
docker-machine create --driver virtualbox dev
"dev" is the name of the virtual machine
2/ Stop the docker machine to mount a folder from the host
docker-machine stop dev
3/ With virtualbox we add a shared folder (you can use the GUI to add it if you want)
VBoxManage sharedfolder add dev --name "f/shared_folder" --hostpath "f:/host_folder" --automount
docker-machine start dev
docker-machine ssh dev
sudo vi /mnt/sda1/var/lib/boot2docker/bootlocal.sh
mkdir -p /f/datas
mount -t vboxsf -o defaults,uid=`id -u docker`,gid=`id -g docker` f/shared_folder //f/datas
exit
dm stop dev && dm start dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment