构建时如何查看容器中的文件?

时间:2019-03-06 13:58:55

标签: perl docker

在构建容器时,我收到下一条消息:

Step 13/29 : RUN source $PERLBREW_ROOT/etc/bashrc && perlbrew install -j 8 --notest --switch $PERL_VERSION
 ---> Running in a4efbc14a7b5

Fetching perl 5.24.1 as /opt/perlbrew/dists/perl-5.24.1.tar.bz2
Download http://www.cpan.org/authors/id/S/SH/SHAY/perl-5.24.1.tar.bz2 to /opt/perlbrew/dists/perl-5.24.1.tar.bz2
Installing /opt/perlbrew/build/perl-5.24.1/perl-5.24.1 into /opt/perlbrew/perls/perl-5.24.1

This could take a while. You can run the following command on another shell to track the status:

  tail -f /opt/perlbrew/build.perl-5.24.1.log

但是如果还没有容器,该怎么做tail -f /opt/perlbrew/build.perl-5.24.1.log

1 个答案:

答案 0 :(得分:3)

除了可以尝试访问该中间容器(即使可以执行该操作)之外,它在其他情况下也无济于事,例如当您拥有配置项且构建失败时,您需要检查原因。因此,我建议使用perlbrew选项在-v中切换到详细模式,这会使输出进入STDOUT而不是文件。

-v| --verbose
Log output to STDOUT rather than a log file.