Skip to content

Instantly share code, notes, and snippets.

@inhumantsar
Forked from phuongnd08/install_docker.sh
Last active August 29, 2015 14:10
Show Gist options
  • Save inhumantsar/56e7ba7bea6e8a62f57e to your computer and use it in GitHub Desktop.
Save inhumantsar/56e7ba7bea6e8a62f57e to your computer and use it in GitHub Desktop.
#!/bin/bash
if ! which wget > /dev/null; then
yum install -y wget
fi
export DOCKER_VERSION=1.3.0
pushd /tmp
if [ ! -f /usr/bin/docker ]; then
# First we install the docker-io package to have us setup all the nasty things
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum --enablerepo epel-testing install -y docker-io
fi
# Then we override with recent binaries and files
wget https://get.docker.com/builds/Linux/x86_64/docker-$DOCKER_VERSION.tgz
tar xzf docker-$DOCKER_VERSION.tgz
sudo mv usr/local/bin/docker /usr/bin/
wget https://github.com/docker/docker/archive/v$DOCKER_VERSION.tar.gz
tar xzf v$DOCKER_VERSION.tar.gz
mv docker-$DOCKER_VERSION/contrib/init/sysvinit-redhat/docker /etc/init.d/
mv docker-$DOCKER_VERSION/contrib/init/sysvinit-redhat/docker.sysconfig /etc/sysconfig/docker
chkconfig docker on
nohup service docker restart
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment