【问题标题】:Dockerfile hide output of RUN commandDockerfile 隐藏 RUN 命令的输出
【发布时间】:2018-10-13 08:19:04
【问题描述】:

如果我的 Dockerfile 中有几个 RUN 命令,我如何让它不打印特定命令的任何输出,例如忽略来自 apt-get update 的打印语句?

【问题讨论】:

    标签: docker dockerfile


    【解决方案1】:

    这对我有用

    FROM ubuntu:16.04
    
    RUN which nano || echo no nano
    RUN bash -c "apt-get update &> /dev/null"
    RUN bash -c "apt-get install nano &> /dev/null"
    RUN which nano
    

    (真的从Redirecting command output in docker得到解决方案)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-14
      • 2020-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-22
      • 1970-01-01
      • 2012-06-04
      相关资源
      最近更新 更多