CentOS7 install Docker

In Centos7, the default version of docker yum source is too low, you need to manually set up a new docker yum source, and then install it

1. If there is installation, you need to delete the old version first##

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

2. Install yum-utils

sudo yum install -y yum-utils

3. Add docker's yum source##

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

4. Update index##

sudo yum makecache fast

5. Install docker (latest version)

sudo yum install docker-ce

6. Check the version of Docker installed##

docker version

view the version of Docker installed

7. Start docker service##

systemctl start docke

8. View the status of docker##

systemctl status docke

**//Stop docker service docker stop **

//Restart dockeservice docker restart

**Commonly used commands of Docker: **

yum -y install docker-ce download the latest version of docke
service docker start start Docker service
service docker stop stop Docker service
service docker restart restart the Docker service
docker version View the version number of Docker
docker pull mirror address:Download the version from the mirror repository
docker save a2a69ca5184a > jt-centOS6.tar exports the image according to the image id
docker save -o redis-3.2.8.tar redis:3.2.8 Export image based on image name
docker load -i docker-centos-6.5.tar specifies the jar package to import the image file
docker rmi a2a69ca5184a Delete the image file according to the Id number
docker rmi -f a2a69ca5184a Forcibly delete the image file, you need to close the container before deleting the image
docker images query all image files
docker inspect index.alauda.cn/tutum/centos:6.5 View the details of the image file
docker tag old image name and port redis-ali:0.0.1 Modify the name of the image
docker build -t Mirror name:The version number is based on the dockerfile to create a mirror file
docker run -d--name container name image name:The version number starts the container according to the image name
docker run -d--name container name(Custom)The image id number starts the container according to the image id
docker run -d-p Virtual machine port:Mirror port--name container name image name:Version number to start the container,And specify the exposed port
docker ps View the active docker container process
Docker ps-a/-all view all containers
docker exec -it container id bash enters the specified container
docker stop Container Id number to stop the specified container
docker start Container Id number to start the created container
docker stop $(docker ps-q) & docker rm $(docker ps-aq)Close and delete all containers
docker rm container Id delete the specified container

Recommended Posts

CentOS7 install Docker
Centos7 install Docker
Centos7 install docker18
centos7 install docker
CentOS 6 install Docker
Centos8 install Docker
CentOS 8-dnf install docker
install Docker on centos6.5
CentOS 7 install Docker CE
1.5 Install Centos7
Install docker transfer on Centos7
Install docker on Centos system
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS7 install GlusterFS
ubuntu18.04 install docker
CentOS 7.4 install Zabbix 3.4
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Install MySql with Docker in CentOS7
Centos7 install Python2.7
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
Docker installation (CentOS7 installation)
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
Container study notes CentOS7 install Docker
CentOS6 install mist.io
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Install and use docker under CentOS 6.8
docker install ubuntu
Centos7 install Nginx
CentOS6.5 install CDH5.13
Install Centos7 operating system in Docker
Centos install Python3
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS7 docker installation
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8