Installation CentOS 8 Docker (Ali-based mirror sites)

Docker is an open source application container engine, using sandbox technology, so that the program can operate safely. This article describes the method of mounting Docker environment on CentOS 8.

About the implementation of three commands, download Docker from Ali cloud image. Note that the command of the second link given below are the latest links when writing the article, the actual download, it is best to check for updates.

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
dnf install https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm
dnf install docker-ce

Then, set up and start the boot from Kai Docker Docker:

systemctl enable docker.service
systemctl start docker.service

Then, you can use the Docker.


Then, we can be created using a Docker container:

docker info                # 查看docker的信息
docker search img_name     # 搜索名为img_name的镜像
docker pull img_name       # 将名为img_name的镜像下载到本地
docker images              # 查看本地已有的镜像
docker rmi img_name        # 删除名为img_name的镜像

docker ps                  # 列出正在运行的容器
docker ps -a               # 列出所有的容器
docker run -itd --name=container_name img_name  # 使用img_name以交互模式在后台运行分配了伪终端的名为container_name的镜像

docker start container_name/container_id        # 通过容器名字或ID启动容器
docker stop container_name/container_id         # 通过容器名字或ID停止容器
docker restart container_name/container_id      # 通过容器名字或ID重启容器
docker rm container_name/container_id           # 通过容器名字或ID删除容器

docker exec -it container_name/container_id /bin/bash   # 通过容器名字或ID进入容器
exit               # 退出容器

Guess you like

Origin www.cnblogs.com/mrfangd/p/CentOS_8-Install-Docker.html