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
sudo yum remove docker docker-common container-selinux docker-selinux docker-engine
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum install docker-ce
docker version
view the version of Docker installed
systemctl start docke
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