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

Summary of common commands in 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 explains "the summary of common docker commands". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "docker common command summary" it!

A brief personal summary:

Parameter usage syntax example search searches for image docker search image name docker search nginxpull in docker hub downloads image to local docker pull image name: tagdocker pull nginx:latestpush pushes specified image to docker image server docker push local image: tagdocker push nginx:V1images views all local docker images docker imagesdocker imaegsrun creation container And run docker run parameter image name: tagdocker-d run nginx:latesthistory to view the image formation process docker history local image name: tagdocker history nginx:V1start start container docker start container ID or container name docker strat 3d265463456stop stop container docker stop container ID or container name docker stop nginxbuild create image docker build parameter image name: tag dockerfile directory docker build-t nginx:V1 / opt/attach current shell connection running container docker attach container name docker Attach nginxcommit saves the current container as image / snapshot docker commit container ID or container name new image name: tagdocker commit nginx nginx:V2cp container and host copy files docker cp container name: file directory / name local directory docker cp / var/www/html/ nginx:/var/www/htmlcreate create container but do not start container docker create parameter image name docker create nginx:V1diff view container changes docker diff container ID or container Name docker diff nginxexec execute commands in container docker exec parameters container ID or name command docker exec centos echo '123'login login docker mirror source server docker login server address docker loginlogout exit login image source server docker logoutdocker logoutlogs output log information of the current container docker logs container ID or name docker logs nginxport view container port mapping docker port container ID or name docker port nginxps list container docker ps parameter Docker ps-arestart restart container docker restart container ID or name docker restart nginxrm delete container docker rm parameter container ID or name docker rm nginxrmi delete local image docker rmi image name: tagdocker rmi nginx:V1save save image as tar package docker save-o tar file name image name: tagdocker save-o nginx.tar nginx:V1top view process information in container docker top container ID or name docker top nginxversion view docker software version docker versiondocker versionevents view docker server Server real-time docker events parameter docker events-since= "1577321423" import import docker from tar file to image docker import parameter tar file image name: tagdocker import nginx.tar nginx:V2export export image from docker image to tar file docker export parameter image name: tag tar file docker export nginx:V2 nginx2.tarinfo view docker system information docker infodocker infoinspect view container details docker inspect container ID or name docker inspect nginx grep IPAddresskill kill the running container docker Kill parameter container ID or name docker kill nginxload loaded from tar file as docker image docker load-I tar file image name: tagdocker load-I nginx2.tar nginx:V3pause pause container docker pause container ID/ name docker pause nginxtag image tagged docker tag image name: tag new image name: tagdocker tag nginx:V3 mynginx:V4unpause unpaused container docker unpause container ID/ name docker unpause nginxwait blocking operation until the container stops Then print out its exit code docker wait CONTAINERdocker wait CONTAINER so far. I believe you have a deeper understanding of the "summary of common docker commands". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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