Skip to content

Instantly share code, notes, and snippets.

@hnakamur
Last active August 29, 2015 14:19
Show Gist options
  • Save hnakamur/6c278992cea2b14026c8 to your computer and use it in GitHub Desktop.
Save hnakamur/6c278992cea2b14026c8 to your computer and use it in GitHub Desktop.
shell script for installing latest docker and docker-compose on CentOS7 (MIT license)
#!/bin/sh
set -e
sudo yum install -y git xz
if [ ! -f /usr/bin/docker ]; then
sudo curl -L -o /usr/bin/docker https://get.docker.com/builds/Linux/x86_64/docker-latest
sudo chmod +x /usr/bin/docker
fi
if [ ! -f /usr/lib/systemd/system/docker.service ]; then
sudo curl -L -o /usr/lib/systemd/system/docker.service https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.service
sudo curl -L -o /usr/lib/systemd/system/docker.socket https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.socket
sudo groupadd --system docker
sudo systemctl enable docker
sudo systemctl start docker
fi
if [ ! -f /usr/bin/docker-compose ]; then
curl -L -o /usr/bin/docker-compose https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m`
chmod +x /usr/bin/docker-compose
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment