I'm just starting to learn Docker, and I'm trying to get a simple setup with boot2docker on Windows. I could not find in any tutorial or samples online how to make my project files accessible to the boot2docker VM.
I downloaded boot2docker, and succeeded in installing it and getting it up and running. I can also ssh into it and run the hello world docker example, so I know I have a working Docker installation in the VM.
Now, the question: How do I get my Dockerfile
and my application files on the boot2docker VM so that I can build a Docker container?
In other words, I'm trying to do this from the boot2docker VM:
$ cd /some-directory-from-my-host-os $ docker build .
I tried following the instructions on https://github.com/boot2docker/boot2docker#folder-sharing and setup a SAMBA share, and I can successfully connect from Windows to the share at \\192.168.59.103\data
but that doesn't tell me how to access that same directory from within the boot2docker VM.
I feel like the answer might be obvious, but I'm sure I'm not the only one who will hit that wall. Thanks for your help!
Since boot2docker 1.3, the ability to mount a shared folder has been added, so the VM can share your dev folder directly. More information here: https://github.com/boot2docker/boot2docker#virtualbox-guest-additions
Open the project in Visual Studio, and choose one of the following options: Select Docker Support from the Project menu. Right-click the project in Solution Explorer and select Add > Docker Support.
Not sure if it helps under windows. But for Mac see:
boot2docker together with VirtualBox Guest Additions
How to mount /Users into boot2docker
https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c
tl;dr Build your own custom boot2docker.iso with VirtualBox Guest Additions (see link) or download http://static.dockerfiles.io/boot2docker-v1.0.1-virtualbox-guest-additions-v4.3.12.iso and save it to ~/.boot2docker/boot2docker.iso.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With