Skip to content

Instantly share code, notes, and snippets.

@StudioSpindle
Last active May 22, 2019 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StudioSpindle/09ac39d66c464b389bb2062fb4e70187 to your computer and use it in GitHub Desktop.
Save StudioSpindle/09ac39d66c464b389bb2062fb4e70187 to your computer and use it in GitHub Desktop.
Install Docker on CentOs 7+
# 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