Last active
March 6, 2020 08:09
-
-
Save phuctm97/53941eb49534fa47f657443b4b893411 to your computer and use it in GitHub Desktop.
Install Docker CE on CentOS and RHEL 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
!#/bin/bash | |
################################# | |
# Install Docker CE on CentOS 7 # | |
################################# | |
# Update system. | |
sudo yum update -y | |
# Install Docker CE by downloading and executing installation script | |
# officially provided by Docker team. | |
curl -fsSL https://get.docker.com/ | sh | |
# Add current user to `docker` group. | |
sudo usermod -a -G docker $USER | |
# Start and enable `docker` service. | |
sudo systemctl start docker | |
sudo systemctl enable docker |
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
#!/bin/bash | |
############################### | |
# Install Docker CE on RHEL 7 # | |
############################### | |
# Update system. | |
sudo yum update -y | |
# Install required packages. | |
sudo yum install -y yum-utils \ | |
device-mapper-persistent-data \ | |
lvm2 | |
# Install container-selinux. | |
# Check for latest version: http://mirror.centos.org/centos/7/extras/x86_64/Packages/. | |
sudo yum install -y \ | |
http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm | |
# Set up Docker repository. | |
sudo yum-config-manager \ | |
--add-repo \ | |
https://download.docker.com/linux/centos/docker-ce.repo | |
# Install Docker CE and tools. | |
sudo yum install -y \ | |
docker-ce \ | |
docker-ce-cli \ | |
containerd.io | |
# Add current user to `docker` group. | |
sudo usermod -a -G docker $USER | |
# Start and enable `docker` service. | |
sudo systemctl start docker | |
sudo systemctl enable docker | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment