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