Install Docker CE on CentOS 7
What is Docker?
Docker is an open source platform that enables developers to build, deploy, run, update and manage containers—standardized, executable components that combine application source code with the operating system (OS) libraries and dependencies required to run that code in any environment.. As written here, Docker Community Edition (CE) is ideal for developers and small teams looking to get started with Docker and experimenting with container-based apps. Docker CE has two update channels, stable and edge:
- Stable gives you reliable updates every quarter.
- Edge gives you new features every month.
If you want to install docker ce on CentOS 7, please use bash script below for easy installation
Make docker.sh file
1 |
vi docker.sh |
Insert this script into docker.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#!/bin/bash # Remove any old versions sudo yum remove docker docker-common docker-selinux docker-engine # Install required packages sudo yum install -y yum-utils device-mapper-persistent-data lvm2 # Configure docker repository sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo # Install Docker-ce sudo yum install docker-ce -y # Start Docker sudo systemctl start docker sudo systemctl enable docker # Post Installation Steps # Create Docker group sudo groupadd docker # Add user to the docker group sudo usermod -aG docker $USER echo "Installation Complete -- Logout and Log back" |
If you want to install docker-compose, add this script
Docker-Compose Script
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# Install docker-compose (check latest version https://github.com/docker/compose/releases) curl -L "https://github.com/docker/compose/releases/download/v2.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose # Permssion +x execute binary chmod +x /usr/local/bin/docker-compose # Create link symbolic ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose sudo chmod 755 /usr/local/bin/docker-compose # Check Version docer-compose echo "Installation Complete -- Logout and Log back" docker-compose --version |
Run the script
1 |
sudo sh docker.sh |
and..whallaaa..You have successfully install docker ce on CentOS 7 including docker compose