Tag: 容器
-
docker–获取容器ip地址
### Example #1 ### $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2e23d01384ac iperf-v1:latest “/usr/bin/iperf -s” 10 minutes ago Up 10 minutes 5001/tcp, 0.0.0.0:32768->5201/tcp compassionate_goodall # Append the container ID (CID) to the end of an inspect $ docker inspect –format ‘{{ .NetworkSettings.IPAddress }}’ 2e23d01384ac 172.17.0.1 ### Example #2 ### #…
-
docker-获取容器ip地址的10个方法
10 EXAMPLES OF HOW TO GET DOCKER CONTAINER IP ADDRESS Much of the motivation to show so many different ways is to help folks see the flexibility that I still run into nearly daily which is hard not to excite a hacker. They can also be viewed in this Gist. 1 2 3 4 5 6…
-
docker–容器的终止、启动、删除
列出正在运行的容器container # docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 50f00085b48f nginx:v2 “nginx -g ‘daemon …” 7 minutes ago Up 6 seconds 0.0.0.0:81->80/tcp webserver2 e033ce3a2d90 nginx “nginx -g ‘daemon …” About an hour ago Up 11 seconds 0.0.0.0:80->80/tcp webserver1 停止容器: # docker stop webserver1 webserver1 # docker stop webserver2 webserver2 启动容器: #…