03-4 docker镜像管理之查看镜像的历史
03-4 docker镜像管理之查看镜像的历史
docker history [镜像名称]:[镜像版本]
docker history [镜像ID]
作用:
查看本地一个镜像的历史(历史分层)信息
我们获取到一个镜像,想知道他默认启动了哪些命令或者都封装了哪些系统层,那么我们可以使用docker history这条命令来获取我们想要的信息
演示如下:
# 查看当前本地镜像
qwe@ubuntu:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu 21821881 d70eaf7277ea 11 days ago 72.9MB
ubuntu latest d70eaf7277ea 11 days ago 72.9MB
mysql latest db2b37ec6181 12 days ago 545MB
hyperledger/caliper 0.4.0 6491b4ec891d 4 weeks ago 356MB
hello-world latest bf756fb1ae65 10 months ago 13.3kB
# 执行命令
qwe@ubuntu:~$ docker history hyperledger/caliper:0.4.0
IMAGE CREATED CREATED BY SIZE COMMENT
6491b4ec891d 4 weeks ago /bin/sh -c #(nop) CMD ["--version"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ENTRYPOINT ["caliper"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ENV CALIPER_BIND_ARGS=-g 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ENV CALIPER_WORKSPACE=/hy… 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ENV PATH=/home/node/.npm-… 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ENV NODE_PATH=/home/node/… 0B
<missing> 4 weeks ago |2 caliper_version=0.4.0 npm_registry= /bin/… 71.9MB
<missing> 4 weeks ago /bin/sh -c #(nop) WORKDIR /hyperledger/calip… 0B
<missing> 4 weeks ago /bin/sh -c #(nop) USER node:node 0B
<missing> 4 weeks ago |2 caliper_version=0.4.0 npm_registry= /bin/… 208MB
<missing> 4 weeks ago /bin/sh -c #(nop) ARG caliper_version 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ARG npm_registry 0B
<missing> 14 months ago /bin/sh -c #(nop) CMD ["node"] 0B
<missing> 14 months ago /bin/sh -c #(nop) ENTRYPOINT ["docker-entry… 0B
<missing> 14 months ago /bin/sh -c #(nop) COPY file:238737301d473041… 116B
<missing> 14 months ago /bin/sh -c apk add --no-cache --virtual .bui… 5.5MB
<missing> 14 months ago /bin/sh -c #(nop) ENV YARN_VERSION=1.17.3 0B
<missing> 14 months ago /bin/sh -c addgroup -g 1000 node && addu… 65.4MB
<missing> 14 months ago /bin/sh -c #(nop) ENV NODE_VERSION=10.16.3 0B
<missing> 18 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
<missing> 18 months ago /bin/sh -c #(nop) ADD file:a86aea1f3a7d68f6a… 5.53MB
IMAGE:编号
CREATED:创建的
CREATED BY :基于那些命令创建的
SIZE:大小
COMMENT:评论