Script Analytics

2015/12/09

Install docker-machine in your Boot2Docker VM

Boot2Docker still has a non-persistent filesystem.
The following commands will download docker-machine and install it in /usr/local/bin at each image start.

Once again, we will modify the /var/lib/boot2docker/bootlocal.sh file :
sudo vi /var/lib/boot2docker/bootlocal.sh
We add the following commands to automatically install docker-machine 0.5.2 :
# install docker machine
curl -L https://github.com/docker/machine/releases/download/v0.5.2/docker-machine_linux-amd64.zip > machine.zip && \
   unzip machine.zip && \
   rm -f machine.zip && \
   sudo mv -f docker-machine* /usr/local/bin

Install docker-compose in your Boot2Docker VM

Since Boot2Docker uses Tiny Core Linux, which runs from RAM, it does not persist filesystem changes by default.
The following commands will download docker-compose and install it in /usr/local/bin at each image start.

Once again, we will modify the /var/lib/boot2docker/bootlocal.sh file :
sudo vi /var/lib/boot2docker/bootlocal.sh
We add the following commands to automatically install docker-compose 1.5.0 :
# install docker-compose
curl -L https://github.com/docker/compose/releases/download/1.5.0/docker-compose-`uname -s`-`uname -m` | \
  sudo tee /usr/local/bin/docker-compose > /dev/null && \
  sudo chmod +x /usr/local/bin/docker-compose

2015/11/09

Auto-mount Windows folder to Boot2Docker VM

Boot2Docker is a simple VM used to run Docker in Windows.
With Docker-Machine, you are able to run Docker container inside the Boot2Docker VM from your Windows CMD.
And Everything is bundled into Docker Toolbox.


However, It can be annoying to execute shell scripts inside the Boot2Docker VM then retrieve everything on the Windows FS to finally build the Docker image.
In order to simplify my docker workflow and do everything inside the VM, I wanted to have access to my windows workspace from the boot2docker VM.