This repository contains the scripts necessary to create a boot2docker Vagrant box compatible with Parallels provider. If you work solely with Docker, this box lets you keep your Vagrant workflow and work in the most minimal Docker environment possible.
Docker client should be installed on your Mac.
You can do it via official boot2docker
installer or Homebrew: brew install docker
The box is available on Atlas, making it very easy to use it:
vagrant init parallels/boot2docker
vagrant upThen you need to prepare your environment for Docker client
# Copy TLS certificates from the VM to `./tls/` directory on your Mac host:
vagrant ssh -c "sudo cp -r /var/lib/boot2docker/tls `pwd`/"
export DOCKER_TLS_VERIFY="1"
export DOCKER_CERT_PATH="`pwd`/tls"
export DOCKER_HOST="tcp://`vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp"`:2376"Use these commands to disable TLS for Docker daemon (you should do it
only once, after the initial vagrant up):
vagrant ssh -c "sudo sh -c 'echo \"export DOCKER_TLS=no\" > /var/lib/boot2docker/profile'"
vagrant reload
Now you just need to set DOCKER_HOST variable:
unset DOCKER_TLS_VERIFY
export DOCKER_HOST="tcp://`vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp"`:2375"
That's it! Now your VM can be used as Docker host, check it:
docker version
...If you want the actual box file, you can download it from the releases page.
-
Vagrant synced folders has been tested with :
-
Parallels Shared Folders : This is default sharing system for Parallels provider
-
NFS : Set
B2D_NFS_SYNCenvironment variable to use NFS for sharing folders:$ export B2D_NFS_SYNC=1 $ vagrant up
-
-
If you want to tune contents (custom profile, install tools inside the VM), just place a
bootlocal.shscript alongside your Vagrantfile. It will be run in the VM automatically each time aftervagrant up. Refer to boot2docker FAQ to get more details.
If you want to recreate the box, rather than using the binary, then you can use the scripts and Packer template within this repository to do so in seconds.
To build the box, first install the following prerequisites:
- Packer (at least version 0.7.5)
- Parallels Desktop for Mac (version 10.1.2 or higher)
- Parallels Virtualization SDK for Mac
- Bats for integration tests
Then run this command to build the box for Parallels provider:
make parallels
- Author:: Mikhail Zholobov (legal90@gmail.com)
- Author:: Damien Duportal (damien.duportal@gmail.com)