Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Helper script to install boot2docker with added guest additions.
#!/bin/bash
# Helper script to install boot2docker with added guest additions
# Directory /Users will be mounted as shared dir.
#
# Source:
# https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c
BOOT2DOCKER_PATH=~/.boot2docker/boot2docker.iso
RELEASE=http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso
RELEASE_MD5=5e39eb7e960e30b433ffefb02bfce4ba
CURRENT_MD5=$(md5 $BOOT2DOCKER_PATH | cut -f4 -d" ")
if [ "$RELEASE_MD5" == "$CURRENT_MD5" ]
then
echo "boot2docker with guest additions already downloaded."
exit 0
fi
boot2docker stop
mv $BOOT2DOCKER_PATH $BOOT2DOCKER_PATH.backup
curl -L $RELEASE -o $BOOT2DOCKER_PATH
VBoxManage sharedfolder add boot2docker-vm -name home -hostpath /Users
boot2docker up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.