Last active
May 22, 2019 10:33
-
-
Save StudioSpindle/09ac39d66c464b389bb2062fb4e70187 to your computer and use it in GitHub Desktop.
Install Docker on CentOs 7+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this on a CentOS 7+ VM in a Google cloud instance | |
# Make sure it has >3 GB memory with disk size a disk size >20 GB | |
# --------------------------------------------------------------- | |
# Install needed distribution packages: | |
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 && \ | |
# Configure repo: | |
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \ | |
# Install docker and required packages: | |
sudo yum -y -q install \ | |
docker-ce \ | |
epel-release \ | |
python-pip \ | |
jq && \ | |
sudo pip install docker-compose && \ | |
# Update Python packages: | |
sudo yum upgrade python* && \ | |
# Add user to the docker group: | |
sudo usermod -aG docker $(whoami) && \ | |
# Add docker to automatically start at boot time: | |
sudo systemctl enable docker.service && \ | |
# Finally start the docker service: | |
sudo systemctl start docker.service && \ | |
# Run tests to verify installation: | |
sudo docker run hello-world && \ | |
sudo docker -v && \ | |
exit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment