docker 学习操作记录 1

记录1

  1 Xshell 6 (Build 0115)
  2 Copyright (c) 2002 NetSarang Computer, Inc. All rights reserved.
  3 
  4 Type `help' to learn how to use Xshell prompt.
  5 [C:\~]$ 
  6 
  7 Connecting to 192.168.114.130:22...
  8 Connection established.
  9 To escape to local shell, press Ctrl+Alt+].
 10 
 11 Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-70-generic x86_64)
 12 
 13  * Documentation:  https://help.ubuntu.com
 14  * Management:     https://landscape.canonical.com
 15  * Support:        https://ubuntu.com/advantage
 16 
 17  * Overheard at KubeCon: "microk8s.status just blew my mind".
 18 
 19      https://microk8s.io/docs/commands#microk8s.status
 20 
 21 13 个可升级软件包。
 22 10 个安全更新。
 23 
 24 Last login: Tue Oct 15 13:18:39 2019
 25 root@coder:~# ls
 26 root@coder:~# 
 27 root@coder:~# 
 28 root@coder:~# 
 29 root@coder:~# 
 30 root@coder:~# cd /etc/docker/
 31 root@coder:/etc/docker# ls
 32 daemon.json  key.json
 33 root@coder:/etc/docker# more daemon.json 
 34 {
 35   "registry-mirrors": ["https://uog9ef8i.mirror.aliyuncs.com"]
 36 }
 37 root@coder:/etc/docker# whereis dig
 38 dig: /usr/bin/dig /usr/share/man/man1/dig.1.gz
 39 root@coder:/etc/docker# ping https://uog9ef8i.mirror.aliyuncs.com
 40 ^C
 41 root@coder:/etc/docker# nslookup https://uog9ef8i.mirror.aliyuncs.com
 42 Server:        127.0.1.1
 43 Address:    127.0.1.1#53
 44 
 45 ** server can't find https://uog9ef8i.mirror.aliyuncs.com: SERVFAIL
 46 
 47 root@coder:/etc/docker# apt-cache search docker
 48 libcib-dev - cluster resource manager CIB library development
 49 libcib4 - cluster resource manager CIB library
 50 libcrmcluster-dev - cluster resource manager cluster library development
 51 libcrmcluster4 - cluster resource manager cluster library
 52 libcrmcommon-dev - cluster resource manager common library development
 53 libcrmcommon3 - cluster resource manager common library
 54 libcrmservice-dev - cluster resource manager service library development
 55 libcrmservice3 - cluster resource manager service library
 56 liblrmd-dev - cluster resource manager LRMD library development
 57 liblrmd1 - cluster resource manager LRMD library
 58 libpe-rules2 - cluster resource manager Policy Engine rules library
 59 libpe-status10 - cluster resource manager Policy Engine status library
 60 libpengine-dev - cluster resource manager Policy Engine library development
 61 libpengine10 - cluster resource manager Policy Engine library
 62 libstonithd-dev - cluster resource manager STONITH daemon library development
 63 libstonithd2 - cluster resource manager STONITH daemon library
 64 libtransitioner2 - cluster resource manager transitioner library
 65 pacemaker - cluster resource manager
 66 pacemaker-cli-utils - cluster resource manager command line utilities
 67 pacemaker-common - cluster resource manager common files
 68 pacemaker-doc - cluster resource manager HTML documentation
 69 pacemaker-resource-agents - cluster resource manager general resource agents
 70 python-magnumclient - client library for Magnum API - Python 2.x
 71 python-magnumclient-doc - client library for Magnum API - doc
 72 cadvisor - analyze resource usage and performance characteristics of running containers
 73 ctop - Command line / text based Linux Containers monitoring tool
 74 debocker - docker-powered package builder for Debian
 75 debootstick - Turn a chroot environment into a bootable image
 76 docker - System tray for KDE3/GNOME2 docklet applications
 77 docker-compose - Punctual, lightweight development environments using Docker
 78 docker-registry - Docker toolset to pack, ship, store, and deliver content
 79 docker.io - Linux container runtime
 80 golang-docker-dev - Transitional package for golang-github-docker-docker-dev
 81 golang-github-docker-distribution-dev - Docker toolset to pack, ship, store, and deliver content (source)
 82 golang-github-docker-docker-dev - Externally reusable Go packages included with Docker
 83 golang-github-docker-go-units-dev - parse and print size and time units in human-readable format
 84 golang-github-docker-libkv-dev - Key/Value store abstraction library
 85 golang-github-docker-libtrust-dev - Primitives for identity and authorization
 86 golang-github-docker-notary-dev - tool for running and interacting with trusted collections
 87 golang-github-docker-spdystream-dev - multiplexed stream library using spdy
 88 golang-github-endophage-gotuf-dev - Go implementation of the TUF specification
 89 golang-github-fsouza-go-dockerclient-dev - Docker client library in Go
 90 golang-github-google-cadvisor-dev - analyze resource usage and performance of running containers
 91 golang-github-samalba-dockerclient-dev - Docker client library in Go
 92 golang-github-vishvananda-netlink-dev - netlink library for go
 93 gosu - Simple Go-based setuid+setgid+setgroups+exec
 94 karbon - vector graphics application for the Calligra Suite
 95 kdocker - lets you dock any application into the system tray
 96 libnss-docker - nss module for finding Docker containers
 97 magnum-api - OpenStack containers as a service
 98 magnum-common - OpenStack containers as a service - API server
 99 magnum-conductor - OpenStack containers as a service - conductor
100 needrestart - check which daemons need to be restarted after library upgrades
101 ovn-docker - OVN Docker drivers
102 pacemaker-remote - cluster resource manager proxy daemon for remote nodes
103 pidgin - graphical multi-protocol instant messaging client for X
104 python-dockerpty - Pseudo-tty handler for docker Python client (Python 2.x)
105 python-magnum - OpenStack containers as a service - Python library
106 python3-dockerpty - Pseudo-tty handler for docker Python client (Python 3.x)
107 python3-magnumclient - client library for Magnum API - Python 3.x
108 rawdns - raw DNS interface to the Docker API
109 ruby-docker-api - Ruby gem to interact with docker.io remote API
110 sen - Terminal user interface for docker engine
111 systemd-docker - wrapper for "docker run" to handle systemd quirks
112 vim-syntax-docker - Docker container engine - Vim highlighting syntax files
113 docker-doc - Linux container runtime -- documentation
114 golang-github-docker-containerd-dev - runC develpoment files
115 golang-github-opencontainers-runc-dev - Open Container Project - development files
116 python-docker - Python wrapper to access docker.io's control socket
117 python3-docker - Python 3 wrapper to access docker.io's control socket
118 cockpit-docker - Cockpit user interface for Docker containers
119 docker-ce-cli - Docker CLI: the open-source application container engine
120 docker-ce - Docker: the open-source application container engine
121 root@coder:/etc/docker# systemctl start docker
122 root@coder:/etc/docker# systemctl status docker
123 ● docker.service - Docker Application Container Engine
124    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
125    Active: active (running) since 三 2019-12-04 13:19:18 CST; 3min 25s ago
126      Docs: https://docs.docker.com
127  Main PID: 1841 (dockerd)
128     Tasks: 12
129    Memory: 124.7M
130       CPU: 1.155s
131    CGroup: /system.slice/docker.service
132            └─1841 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
133 
134 12月 04 13:19:13 coder dockerd[1841]: time="2019-12-04T13:19:13.268794332+08:00" level=warning msg="Your kernel does not support cgroup rt period"
135 12月 04 13:19:13 coder dockerd[1841]: time="2019-12-04T13:19:13.268802119+08:00" level=warning msg="Your kernel does not support cgroup rt runtime"
136 12月 04 13:19:13 coder dockerd[1841]: time="2019-12-04T13:19:13.269288992+08:00" level=info msg="Loading containers: start."
137 12月 04 13:19:16 coder dockerd[1841]: time="2019-12-04T13:19:16.447675606+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. D
138 12月 04 13:19:16 coder dockerd[1841]: time="2019-12-04T13:19:16.705922675+08:00" level=info msg="Loading containers: done."
139 12月 04 13:19:18 coder dockerd[1841]: time="2019-12-04T13:19:18.182512939+08:00" level=info msg="Docker daemon" commit=633a0ea838 graphdriver(s)=overlay2 version=19.03.5
140 12月 04 13:19:18 coder dockerd[1841]: time="2019-12-04T13:19:18.257751749+08:00" level=info msg="Daemon has completed initialization"
141 12月 04 13:19:18 coder systemd[1]: Started Docker Application Container Engine.
142 12月 04 13:19:18 coder dockerd[1841]: time="2019-12-04T13:19:18.550338764+08:00" level=info msg="API listen on /var/run/docker.sock"
143 12月 04 13:22:39 coder systemd[1]: Started Docker Application Container Engine.
144 root@coder:/etc/docker# docker image ls
145 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
146 nginx                         latest              231d40e811cd        11 days ago         126MB
147 centos                        latest              0f3e07c0138f        2 months ago        220MB
148 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
149 root@coder:/etc/docker# docker run --name webserver -d -p 80:80 nginx
150 e188b46041a5885c20f2ff3d2b4e68ee815081a50cc64e96b724969a7122227a
151 root@coder:/etc/docker# docker container ls
152 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
153 e188b46041a5        nginx               "nginx -g 'daemon of…"   9 seconds ago       Up 7 seconds        0.0.0.0:80->80/tcp   webserver
154 root@coder:/etc/docker# ip addr
155 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
156     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
157     inet 127.0.0.1/8 scope host lo
158        valid_lft forever preferred_lft forever
159     inet6 ::1/128 scope host 
160        valid_lft forever preferred_lft forever
161 2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
162     link/ether 00:0c:29:1c:70:11 brd ff:ff:ff:ff:ff:ff
163     inet 192.168.44.135/24 brd 192.168.44.255 scope global dynamic ens32
164        valid_lft 1536sec preferred_lft 1536sec
165     inet6 fe80::4167:6166:4b25:b08f/64 scope link 
166        valid_lft forever preferred_lft forever
167 3: ens35: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
168     link/ether 00:0c:29:1c:70:1b brd ff:ff:ff:ff:ff:ff
169     inet 192.168.114.130/24 brd 192.168.114.255 scope global dynamic ens35
170        valid_lft 1536sec preferred_lft 1536sec
171     inet6 fe80::bedc:3e6a:d88c:c39e/64 scope link 
172        valid_lft forever preferred_lft forever
173 4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
174     link/ether 02:42:43:27:75:6c brd ff:ff:ff:ff:ff:ff
175     inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
176        valid_lft forever preferred_lft forever
177     inet6 fe80::42:43ff:fe27:756c/64 scope link 
178        valid_lft forever preferred_lft forever
179 6: veth953ea42@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default 
180     link/ether f6:12:e5:ea:7a:8c brd ff:ff:ff:ff:ff:ff link-netnsid 0
181     inet6 fe80::f412:e5ff:feea:7a8c/64 scope link 
182        valid_lft forever preferred_lft forever
183 root@coder:/etc/docker# docker search cmake
184 NAME                                                      DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
185 haffmans/cmake-qt5                                        Ubuntu based image with git, CMake and Qt5 d…   3                                       [OK]
186 msrd0/cmake-qt5                                           Docker image with CMake and Qt5                 2                                       [OK]
187 lycantropos/cmake                                         CMake Docker image                              1                                       [OK]
188 techio/cmake-gcc-runner                                                                                   1                                       
189 jlouazel/cmake-boost                                      Image used to build projects with CMake, g++…   1                                       
190 saschpe/cmakelint                                          cmakelint Docker container based on Alpine …   1                                       [OK]
191 matrim/cmake-examples                                     Used for testing the cmake-examples reposito…   0                                       
192 dhermit/cmakefortran                                      ArchLinux image with CMake, GFortran, Doxyxe…   0                                       [OK]
193 ilssim/cmake-boost-qt5                                    cmake-boost-qt5                                 0                                       [OK]
194 drdanz/cmake                                                                                              0                                       
195 reporter123/cmake                                         buldpack-deps based image with cmake and cla…   0                                       [OK]
196 mickare/cmake-clang                                       Ubuntu image with clang and cmake installed     0                                       [OK]
197 chris298/cmakebuildlinux                                                                                  0                                       
198 devcafe/cmake-cookbook_circleci_ubuntu16.04-intel2018.1   Docker image for testing CMake Cookbook on C…   0                                       [OK]
199 devcafe/cmake-cookbook_circleci_ubuntu16.04-pgi18.4       Docker image for testing CMake Cookbook on C…   0                                       [OK]
200 samblaise/cmake-boost                                     Image with cmake, boost and gcc based on ubu…   0                                       [OK]
201 nercury/cmake-cpp                                         Docker image of various C++ compilers bundle…   0                                       
202 yolo/cmake_resource                                                                                       0                                       
203 mrts/cmake-gtest-valgrind-ubuntu                          Docker image with CMake, Google Test, Valgri…   0                                       
204 haffmans/cmake-qt5-qommando                               Ubuntu based image with git, CMake, Qt5 and …   0                                       [OK]
205 odaceo/cmake                                                                                              0                                       
206 kaskada/cmake-gcc5                                                                                        0                                       [OK]
207 slaves/cmake                                              cmake slave                                     0                                       [OK]
208 2651bc1e8f/cmake_llvm-4.0                                                                                 0                                       
209 ataber/cmake                                                                                              0                                       
210 root@coder:/etc/docker# cmake-clang
211 cmake-clang:未找到命令
212 root@coder:/etc/docker# docker search cmake-clang
213 NAME                                 DESCRIPTION                                   STARS               OFFICIAL            AUTOMATED
214 mickare/cmake-clang                  Ubuntu image with clang and cmake installed   0                                       [OK]
215 ironpark/cmake-clang-openssl-libuv                                                 0                                       
216 thomascassimon/cmake-clang                                                         0                                       
217 daancode/cmake-clang                 Build env for cmake and clang.                0                                       
218 root@coder:/etc/docker# docker container -ls
219 unknown shorthand flag: 'l' in -ls
220 See 'docker container --help'.
221 
222 Usage:    docker container COMMAND
223 
224 Manage containers
225 
226 Commands:
227   attach      Attach local standard input, output, and error streams to a running container
228   commit      Create a new image from a container's changes
229   cp          Copy files/folders between a container and the local filesystem
230   create      Create a new container
231   diff        Inspect changes to files or directories on a container's filesystem
232   exec        Run a command in a running container
233   export      Export a container's filesystem as a tar archive
234   inspect     Display detailed information on one or more containers
235   kill        Kill one or more running containers
236   logs        Fetch the logs of a container
237   ls          List containers
238   pause       Pause all processes within one or more containers
239   port        List port mappings or a specific mapping for the container
240   prune       Remove all stopped containers
241   rename      Rename a container
242   restart     Restart one or more containers
243   rm          Remove one or more containers
244   run         Run a command in a new container
245   start       Start one or more stopped containers
246   stats       Display a live stream of container(s) resource usage statistics
247   stop        Stop one or more running containers
248   top         Display the running processes of a container
249   unpause     Unpause all processes within one or more containers
250   update      Update configuration of one or more containers
251   wait        Block until one or more containers stop, then print their exit codes
252 
253 Run 'docker container COMMAND --help' for more information on a command.
254 
255 root@coder:/etc/docker# docker container ls
256 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
257 e188b46041a5        nginx               "nginx -g 'daemon of…"   2 minutes ago       Up About a minute   0.0.0.0:80->80/tcp   webserver
258 root@coder:/etc/docker# docker exec -it webserver bash
259 root@e188b46041a5:/# echo '<h1> hello, docker1 <h1>' /usr/share/nginx/html/index.html
260 <h1> hello, docker1 <h1> /usr/share/nginx/html/index.html
261 root@e188b46041a5:/# exit
262 exit
263 root@coder:/etc/docker# docker diff webserver
264 C /run
265 A /run/nginx.pid
266 C /var
267 C /var/cache
268 C /var/cache/nginx
269 A /var/cache/nginx/scgi_temp
270 A /var/cache/nginx/uwsgi_temp
271 A /var/cache/nginx/client_temp
272 A /var/cache/nginx/fastcgi_temp
273 A /var/cache/nginx/proxy_temp
274 C /root
275 A /root/.bash_history
276 root@coder:/etc/docker# docker images --format "{{.ID}}: {{.Repository}}"
277 231d40e811cd: nginx
278 0f3e07c0138f: centos
279 4621d4fe2959: ansible/ubuntu14.04-ansible
280 root@coder:/etc/docker# docker image --format "{{.ID}}: {{.Repository}}"
281 unknown flag: --format
282 See 'docker image --help'.
283 
284 Usage:    docker image COMMAND
285 
286 Manage images
287 
288 Commands:
289   build       Build an image from a Dockerfile
290   history     Show the history of an image
291   import      Import the contents from a tarball to create a filesystem image
292   inspect     Display detailed information on one or more images
293   load        Load an image from a tar archive or STDIN
294   ls          List images
295   prune       Remove unused images
296   pull        Pull an image or a repository from a registry
297   push        Push an image or a repository to a registry
298   rm          Remove one or more images
299   save        Save one or more images to a tar archive (streamed to STDOUT by default)
300   tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
301 
302 Run 'docker image COMMAND --help' for more information on a command.
303 
304 root@coder:/etc/docker# docker images --format "{{.ID}}: {{.Repository}}"
305 231d40e811cd: nginx
306 0f3e07c0138f: centos
307 4621d4fe2959: ansible/ubuntu14.04-ansible
308 root@coder:/etc/docker# docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"
309 IMAGE ID            REPOSITORY                    TAG
310 231d40e811cd        nginx                         latest
311 0f3e07c0138f        centos                        latest
312 4621d4fe2959        ansible/ubuntu14.04-ansible   latest
313 root@coder:/etc/docker# docker exec -it webserver bash
314 root@e188b46041a5:/#  echo '<h1>Hello, Docker!</h1>' > /usr/share
315 bash: /usr/share: Is a directory
316 root@e188b46041a5:/#  echo '<h1>Hello, Docker!</h1>' > /usr/share/nginx/html/index.html
317 root@e188b46041a5:/# exit
318 exit
319 root@coder:/etc/docker# docker diff webserver 
320 C /run
321 A /run/nginx.pid
322 C /usr
323 C /usr/share
324 C /usr/share/nginx
325 C /usr/share/nginx/html
326 C /usr/share/nginx/html/index.html
327 C /var
328 C /var/cache
329 C /var/cache/nginx
330 A /var/cache/nginx/client_temp
331 A /var/cache/nginx/fastcgi_temp
332 A /var/cache/nginx/proxy_temp
333 A /var/cache/nginx/scgi_temp
334 A /var/cache/nginx/uwsgi_temp
335 C /root
336 A /root/.bash_history
337 root@coder:/etc/docker# docker commit \
338 >   --author "xue <shuitian_ys@126.com>" \
339 >   --message "modify the default web" \
340 >   nginx:v2
341 Error response from daemon: No such container: nginx:v2
342 root@coder:/etc/docker# docker image ls
343 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
344 nginx                         latest              231d40e811cd        11 days ago         126MB
345 centos                        latest              0f3e07c0138f        2 months ago        220MB
346 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
347 root@coder:/etc/docker# docker container ls
348 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
349 e188b46041a5        nginx               "nginx -g 'daemon of…"   18 minutes ago      Up 18 minutes       0.0.0.0:80->80/tcp   webserver
350 root@coder:/etc/docker# docker commit \
351 >   --author "xue <shuitian_ys@126.com>" \
352 >   --message "modify the default web" \
353 >   webserver \
354 >   nginx:v2
355 sha256:50776ea0e5a44a9c43652f76e3a44ae5f9541dcaa7ae38f343ec9315c8e7c4e5
356 root@coder:/etc/docker# docker image ls
357 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
358 nginx                         v2                  50776ea0e5a4        19 seconds ago      126MB
359 nginx                         latest              231d40e811cd        11 days ago         126MB
360 centos                        latest              0f3e07c0138f        2 months ago        220MB
361 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
362 root@coder:/etc/docker# docker history
363 "docker history" requires exactly 1 argument.
364 See 'docker history --help'.
365 
366 Usage:  docker history [OPTIONS] IMAGE
367 
368 Show the history of an image
369 root@coder:/etc/docker# docker history nginx:v2
370 IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
371 50776ea0e5a4        54 seconds ago      nginx -g daemon off;                            213B                modify the default web
372 231d40e811cd        11 days ago         /bin/sh -c #(nop)  CMD ["nginx" "-g" "daemon…   0B                  
373 <missing>           11 days ago         /bin/sh -c #(nop)  STOPSIGNAL SIGTERM           0B                  
374 <missing>           11 days ago         /bin/sh -c #(nop)  EXPOSE 80                    0B                  
375 <missing>           11 days ago         /bin/sh -c ln -sf /dev/stdout /var/log/nginx…   22B                 
376 <missing>           11 days ago         /bin/sh -c set -x     && addgroup --system -…   57.1MB              
377 <missing>           11 days ago         /bin/sh -c #(nop)  ENV PKG_RELEASE=1~buster     0B                  
378 <missing>           11 days ago         /bin/sh -c #(nop)  ENV NJS_VERSION=0.3.7        0B                  
379 <missing>           11 days ago         /bin/sh -c #(nop)  ENV NGINX_VERSION=1.17.6     0B                  
380 <missing>           11 days ago         /bin/sh -c #(nop)  LABEL maintainer=NGINX Do…   0B                  
381 <missing>           11 days ago         /bin/sh -c #(nop)  CMD ["bash"]                 0B                  
382 <missing>           11 days ago         /bin/sh -c #(nop) ADD file:bc8179c87c8dbb3d9…   69.2MB              
383 root@coder:/etc/docker# 
384 root@coder:/etc/docker# docker history nginx:v2
385 IMAGE               CREATED              CREATED BY                                      SIZE                COMMENT
386 50776ea0e5a4        About a minute ago   nginx -g daemon off;                            213B                modify the default web
387 231d40e811cd        11 days ago          /bin/sh -c #(nop)  CMD ["nginx" "-g" "daemon…   0B                  
388 <missing>           11 days ago          /bin/sh -c #(nop)  STOPSIGNAL SIGTERM           0B                  
389 <missing>           11 days ago          /bin/sh -c #(nop)  EXPOSE 80                    0B                  
390 <missing>           11 days ago          /bin/sh -c ln -sf /dev/stdout /var/log/nginx…   22B                 
391 <missing>           11 days ago          /bin/sh -c set -x     && addgroup --system -…   57.1MB              
392 <missing>           11 days ago          /bin/sh -c #(nop)  ENV PKG_RELEASE=1~buster     0B                  
393 <missing>           11 days ago          /bin/sh -c #(nop)  ENV NJS_VERSION=0.3.7        0B                  
394 <missing>           11 days ago          /bin/sh -c #(nop)  ENV NGINX_VERSION=1.17.6     0B                  
395 <missing>           11 days ago          /bin/sh -c #(nop)  LABEL maintainer=NGINX Do…   0B                  
396 <missing>           11 days ago          /bin/sh -c #(nop)  CMD ["bash"]                 0B                  
397 <missing>           11 days ago          /bin/sh -c #(nop) ADD file:bc8179c87c8dbb3d9…   69.2MB              
398 root@coder:/etc/docker# docker run --name web2 -d -p 81:80 nginx:v2
399 a279c8cb04300e443d9a1679260759d89491f5ebc658b5b930b9cd56f228287d
400 root@coder:/etc/docker# docker image ls
401 REPOSITORY                    TAG                 IMAGE ID            CREATED              SIZE
402 nginx                         v2                  50776ea0e5a4        About a minute ago   126MB
403 nginx                         latest              231d40e811cd        11 days ago          126MB
404 centos                        latest              0f3e07c0138f        2 months ago         220MB
405 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago          461MB
406 root@coder:/etc/docker# docker container ls
407 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
408 a279c8cb0430        nginx:v2            "nginx -g 'daemon of…"   12 seconds ago      Up 10 seconds       0.0.0.0:81->80/tcp   web2
409 e188b46041a5        nginx               "nginx -g 'daemon of…"   21 minutes ago      Up 21 minutes       0.0.0.0:80->80/tcp   webserver
410 root@coder:/etc/docker# 

 

posted on 2019-12-04 16:45  Z_m  阅读(206)  评论(0编辑  收藏  举报

导航