Pre-requisites
- Docker is only supported on 64-bit systems, so make sure you have installed the correct OS. Check your architecture by running the following command:
arch x86_64
- centos-extra repository needs to be enabled.
How to install Docker CE on CentOS 7
You have 2 methods to install Docker CE:
Method 1 – Install using the repository (Recommended)
Install the required packages
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-utils provides the yum-config-manager utility. device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.
Setup the Docker repository
Run the following to setup the docker repository:
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Installing Docker CE
Run the following to install the latest Docker CE version:
yum install docker-ce
Method 2 – Manually install using the RPM
Download the RPM
Go to https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ and download the Docker version you want to install. Use wget, for example:
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
Installing Docker CE
Install the downloaded version of Docker CE using the following command:
yum install /your-path/to/package.rpm
Docker CE is now installed.
Start/Stop Docker service
Start the docker service using the following command:
systemctl start docker
If you want to enable the Docker Service at boot time :
systemctl enable docker
To stop the docker service:
systemctl stop docker
Verify installation
Verify the Docker CE installation by using either:
docker --version
or
docker info
Uninstalling Docker CE
Uninstall Docker by running:
yum remove docker-ce
Delete all images, containers, and volumes using:
rm -rf /var/lib/docker
The post How do I install Docker CE on CentOS 7? appeared first on Quick Click Hosting.
http://ift.tt/2Btd1sO