我们如何在docker history命令的输出中看到完整命令?

问题描述 投票:0回答:1

我们如何在docker history命令的输出中看到第三列(CREATED BY)中的完整命令?

$ docker history docker.company.net/docker-base-images/image:1.0

IMAGE               CREATED             CREATED BY                                      SIZE
c0bddf343fc6        7 days ago          /bin/sh -c #(nop)  LABEL com.company.build.r…   0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG commit                   0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG date                     0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG repo                     0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG org                      0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG version                  0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  USER [company]               0B                  
<missing>           7 days ago          /bin/sh -c apk --no-cache add openjdk8-jre-b…   72.2MB              
<missing>           7 days ago          /bin/sh -c #(nop)  USER [root]                  0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  USER [company:company]       0B                  
<missing>           7 days ago          |5 commit=d64d27b07439e6cfff7422acafe440a946…   3.92MB              
<missing>           7 days ago          /bin/sh -c #(nop)  LABEL com.company.build.r…   0B                  
<missing>           7 days ago          |5 commit=d64d27b07439e6cfff7422acafe440a946…   4.85kB              
<missing>           7 days ago          /bin/sh -c #(nop)  ARG commit                   0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG date                     0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG repo                     0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG org                      0B                  
<missing>           7 days ago          /bin/sh -c #(nop)  ARG version                  0B                  
<missing>           5 weeks ago         /bin/sh -c #(nop)  CMD ["/bin/sh"]              0B                  
<missing>           5 weeks ago         /bin/sh -c #(nop) ADD file:88875982b0512a9d0…   5.53MB              

第三列(CREATED BY)缩写了命令,这使得重建原始Dockerfile变得困难。是否可以在第三列中获取完整命令?

谢谢阅读。

docker dockerfile
1个回答
1
投票

您可以添加标志--no-trunc以查看完整命令。

© www.soinside.com 2019 - 2024. All rights reserved.