Step 1. Install Docker
Docker is a platform to develop, deploy, and run applications with containers.
Depending on your operation system, follow the steps in one of the following topics:
Ensure that all the software requirements are met.
For details, see the following links:
- https://docs.docker.com/install/linux/docker-ce/centos/
- https://docs.docker.com/install/linux/linux-postinstall/
Procedure
-
Install required packages:
Copysudo yum install -y yum-utils \
Copydevice-mapper-persistent-data \
Copylvm2
-
Set up the stable repository:
Copysudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo -
Install the latest version of Docker Engine - Community and containerd:
Copysudo yum install docker-ce docker-ce-cli containerd.io
-
Start Docker:
Copysudo systemctl start docker
-
Create the docker group:
Copysudo groupadd docker
-
Add your user to the docker group:
Copysudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated.
-
Enable docker to start on system boot:
Copysudo systemctl enable docker
Ensure that all the software requirements are met.
For details, see the following links:
- https://docs.docker.com/install/linux/docker-ce/ubuntu/
- https://docs.docker.com/install/linux/linux-postinstall/
Procedure
-
Update the package index:
Copysudo apt-get update
-
Install the necessary packages so apt-get can use packages over HTTPS:
Copysudo apt-get install \
Copyapt-transport-https \
Copyca-certificates \
Copycurl \
Copygnupg-agent \
Copysoftware-properties-common
-
Add the official Docker repository’s GPG key to your system:
Copycurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
-
Add the Docker APT repository to your system’s APT sources:
Copysudo add-apt-repository \
Copy"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
Copy$(lsb_release -cs) \
Copystable”
-
Update the packages again for the newly added Docker repository:
Copysudo apt-get update
-
Install the latest version of Docker CE (Community Edition):
Copysudo apt-get install docker-ce docker-ce-cli containerd.io
-
Create the docker group:
Copysudo groupadd docker
-
Add your user to the docker group:
Copysudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated.
-
Enable docker to start on system boot:
Copysudo systemctl enable docker
Comments
0 comments