[root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest 62c261073ecf 5 days ago 109MB ubuntu 16.04 2a697363a870 3 weeks ago 119MB ubuntu latest 7698f282e524 3 weeks ago 69.9MB hello-world latest fce289e99eb9 5 months ago 1.84kB ngrinder/controller latest e7f8d86685cd 3 years ago 246MB
镜像的运行,以ubuntu:16.04为例
1
docker run -it ubuntu:16.04
可以通过docker ps -a来查看当前运行的镜像:
1 2 3
[root@localhost docker]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 385364730b09 ubuntu:16.04 "/bin/bash" 18 seconds ago Up 16 seconds nervous_jones
[root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 385364730b09 ubuntu:16.04 "/bin/bash" 2 minutes ago Exited (0) 4 seconds ago nervous_jones
[root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx v2 f531cfc896d6 12 minutes ago 109MB nginx latest 62c261073ecf 6 days ago 109MB ubuntu 16.04 2a697363a870 3 weeks ago 119MB ubuntu latest 7698f282e524 3 weeks ago 69.9MB hello-world latest fce289e99eb9 5 months ago 1.84kB ngrinder/controller latest e7f8d86685cd 3 years ago 246MB
通过docker history查看镜像的历史记录:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@localhost ~]# docker history nginx:v2 IMAGE CREATED CREATED BY SIZE COMMENT f531cfc896d6 15 minutes ago nginx -g daemon off; 106B change the default page 62c261073ecf 6 days ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daemon… 0B <missing> 6 days ago /bin/sh -c #(nop) STOPSIGNAL SIGTERM 0B <missing> 6 days ago /bin/sh -c #(nop) EXPOSE 80 0B <missing> 6 days ago /bin/sh -c ln -sf /dev/stdout /var/log/nginx… 22B <missing> 6 days ago /bin/sh -c set -x && addgroup --system -… 54MB <missing> 6 days ago /bin/sh -c #(nop) ENV PKG_RELEASE=1~stretch 0B <missing> 6 days ago /bin/sh -c #(nop) ENV NJS_VERSION=0.3.2 0B <missing> 6 days ago /bin/sh -c #(nop) ENV NGINX_VERSION=1.17.0 0B <missing> 4 weeks ago /bin/sh -c #(nop) LABEL maintainer=NGINX Do… 0B <missing> 4 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B <missing> 4 weeks ago /bin/sh -c #(nop) ADD file:fcb9328ea4c115670… 55.3MB