Installation of centOS docker container

One, docker installation steps

Tip: Before installation, you can use the command: yum check-updatecheck whether yum is the latest version, if a series of things appear, it means it is not the latest, use the command: yum updateupdate.

1. Uninstall the old version

sudo yum remove docker  docker-common docker-selinux docker-engine

2. Installation dependencies

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

3. Add mirror source

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

4. View all docker versions in the warehouse

yum list docker-ce --showduplicates | sort -r

Insert picture description here

5. Install docker

Syntax:, sudo yum install 版本here I installed 18.03.1.ce, there will be a prompt during the installation process Is this ok [y/N]:, just keep typing y .

sudo yum install docker-ce-18.03.1.ce

Insert picture description here

6. Start docker

After entering the command, if nothing is displayed, it means the startup is successful!

sudo systemctl start docker

停止docker:sudo systemctl stop docker

7. Set up docker to start automatically after booting

sudo systemctl enable docker

8. Check if docker is installed successfully

docker version

If something similar to the figure below appears, it means the docker installation is successful!
Insert picture description here

9. Uninstall docker

1. List installed docker

yum list installed | grep docker

Insert picture description here
2. Delete docker

sudo yum -y remove version

Insert picture description here
3. Delete the mirror

rm -rf /var/lib/docker

Guess you like

Origin blog.csdn.net/qq_43073558/article/details/107303210