Skip to content

Instantly share code, notes, and snippets.

@avsm
Created June 17, 2016 15:20
Show Gist options
  • Save avsm/0a80d0d94ba26d7d594eac52987f765d to your computer and use it in GitHub Desktop.
Save avsm/0a80d0d94ba26d7d594eac52987f765d to your computer and use it in GitHub Desktop.
Build and install Docker master on an Ubuntu cloud VM
#!/bin/sh -e
# Build and install latest Docker dev version on an Ubuntu cloud VM
install() {
echo Installing
service docker stop || true
cp -av bundles/latest/binary-daemon/* /usr/bin
cp -av bundles/latest/binary-client/* /usr/bin
service docker start
}
init() {
echo Initialising from fresh boot
apt-get update
apt-get -y install build-essential
curl -sSL https://get.docker.com/ | sh
git clone git://github.com/docker/docker /root/docker
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
}
build() {
cd /root/docker
git pull
make
}
cmd=$1
case $cmd in
install) install ;;
init) init ;;
build) build ;;
*) echo "Usage: $0 [init|build|install]" ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment