Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and deploy docker

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install and deploy docker". The content is simple and easy to understand, and the organization is clear. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "how to install and deploy docker".

The installation execution commands are as follows

//install dependencies

yum -y install gcc

yum -y install gcc-c++

//uninstall older versions

yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine

//install dependencies

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

//Set stable mirror

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

ls /etc/yum.repos.d //Check if installation is successful

Update package index

yum makecache fast

//List docker versions from highest to lowest

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

//Install the specified version

yum install docker-ce-20.10.1 docker-ce-cli-20.10.1 containerd.io

//Install the latest version

yum -y install docker-ce

//View docker version

docker version

//start docker

systemctl start docker

//docker status

systemctl status docker

//Close docker

systemctl stop docker

*** Common commands

docker search tomcat Search tomcat images

docker images View all current images

docker pull centos download image

docker run centos run image

docker images View Mirrors

docker rmi Mirror ID Delete Mirror

docker ps View containers in startup

docker ps -a View all containers

docker stop Container ID Stop Container

docker rm Container ID Delete Container

docker install nginx

1. Download nginx

docker pull nginx

2. Run ngxinx

docker run -p 8080:80 -d docker.io/nginx Map docker port 80 to host port 8080 Start

You can access it.

Query Delete docker

1. List the specific names of docker packages

$ sudo yum list installed | grep docker

containerd.io.x86_64 1.2.4-3.1.el7

docker-ce.x86_64 3:18.09.3-3.el7

docker-ce-cli.x86_64 1:18.09.3-3.el7

2. Delete docker

$ sudo yum -y remove containerd.io.x86_64 \

docker-ce.x86_64 \

docker-ce-cli.x86_64

Delete docker directly

sudo yum remove docker \

docker-io \

docker-client \

docker-client-latest \

docker-common \

docker-latest \

docker-latest-logrotate \

docker-logrotate \

docker-engine

Note: The above command only deletes the docker runtime environment, and does not delete images, containers, volume files, and user-created profiles.

Clear Mirrors and Container Files:

sudo rm -rf /var/lib/docker

Manually find and delete user-created profiles.

That's all for "docker how to install deployment", thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report