Docker common commands

【Docker common commands】Mirror common commands


•docker search
•docker pull
•docker images
--all -a list all mirrors
--digests show digests
--quiet -q only show mirror ID
•docker rmi
•docker save
ocker save busybox > busybox.tar
docker save --output busybox.tar busybox
•docker load
docker load < busybox .tar.gz
docker load --input fedora.tar _
•docker build
docker build -t yyyejunyu / nginx: test .

【Docker common commands】Common commands for containers


•docker run
docker run -d -p 91:80 nginx
•docker ps
•docker stop
•docker kill
•docker start
•docker restart
•docker inspect
•into the container
docker attach 784 fd3b294d7
docker exec -it container id / bin/bash
•docker rm
delete all containers
docker rm -f $( docker ps - a - q )
•docker export
docker export red_panda > latest.tar
docker export --output = "latest.tar" red_panda
•docker import
docker import nginx2.tar nginx

【Docker common commands】Container backup


1. Take a snapshot of the container
docker commit -p 30 b8f18f20b4 (container id ) container - backup
will generate a mirror
2. Packing
docker save -o ~/ container -backup.tar container - backup
Container recovery
docker load -i ~ / container -backup.tar
docker run -d -p 80 : 80 container - backup

Copyright statement: The content of this article is contributed by Alibaba Cloud's real-name registered users. The copyright belongs to the original author. The Alibaba Cloud developer community does not own the copyright and does not assume the corresponding legal responsibility. For specific rules, please refer to the " Alibaba Cloud Developer Community User Service Agreement " and " Alibaba Cloud Developer Community Intellectual Property Protection Guidelines ". If you find any content suspected of plagiarism in this community, fill out the infringement complaint form to report it. Once verified, this community will delete the allegedly infringing content immediately.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00