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 docker commands (2)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

< nginx.tar.gz 556c5fb0d91b: Loading layer [==================================================>

< nginx.tar.gz 556c5fb0d91b: Loading layer [==================================================>

] 72.48MB/72.48MB 49434cc20e95: Loading layer [= = >] 57.67MB/57.67MB 75248c0d5438: Loading layer [= = >] 3.584kB/3.584kB Loaded image: nginx:latest root@jia:/jia/jia# docker images / / View all images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest f7bb5701a33c 12 days ago 126MB centos latest 0f3e07c0138f 3 months ago 220MB root@jia:/jia/jia# pause pause container syntax docker pause container ID/ container name example pause centos container Root@jia:/jia/jia# docker run-itd-- name centos centos:latest / / create and run 48e49042b927f427aed68437e12e5acd14b82e3a33a71b6f236bcef5c3edd41d root@jia:/jia/jia# docker ps / / View containers CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48e49042b927 centos:latest "/ bin/bash" 2 seconds ago Up 2 seconds centos root@jia:/jia/jia# docker pause centos centos root@jia:/jia/jia# docker ps-a / / View all containers CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48e49042b927 centos:latest "/ bin/ Bash "14 seconds ago Up 13 seconds (Paused) centos root@jia:/jia/jia# container adds (Paused) # # unpause cancels container pause state syntax docker unpause container ID/ container name example cancels pause operation of centos container root@jia:/jia/jia# docker ps-a / / View all containers CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48e49042b927 centos:latest" / bin/bash "14 seconds ago Up 13 seconds (Paused) centos root@jia:/jia/jia# docker unpause centos centos root@jia:/jia/jia# docker ps-a / / View all containers CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48e49042b927 centos:latest "/ bin/bash" 5 minutes ago Up 5 minutes centos root@jia:/jia/jia# tag to label the image syntax docker tag source image ID/ source image name: tag (version) target image name: tag (version) display For example, re-label the centos image root@jia:/jia/jia# docker tag centos:latest centos:V1 root@jia:/jia/jia# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest f7bb5701a33c 12 days ago 126MB centos V1 0f3e07c0138f 3 months ago 220MB centos latest 0f3e07c0138f 3 months ago 220MB root@jia:/jia/jia# wait blocking operation until the container stops Then print out its exit code syntax docekr wait container ID/ container name example root@jia:/jia/jia# docker run-itd-- name nginx nginx / / create startup container 57af5446f0eaff56a54c3a5559ac0073511de9b9f48c93ff04bbcd0c62b3a809 root@jia:/jia/jia# docker ps / / check container CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 57af5446f0ea nginx "nginx-g 'daemon of..." 4 seconds ago Up 3 seconds 80/tcp nginx root@jia:/jia/jia# docker inspect nginx | grep IPAddress / / View container IP address "SecondaryIPAddresses": null, "IPAddress": "172.17.0.2", "IPAddress": "172.17.0.2", root@jia:/jia/jia# curl 172.17.0.2 / / access the container's port 80 Welcome to nginx! Body {width: 35eme; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif;} Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com.

Thank you for using nginx.

Root@jia:/jia/jia# docker wait nginx / / start blocking root@jia:~# curl 172.18.0.2 / / found that the container nginx page cannot be accessed

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