【问题标题】:Where execute RUN command from Dockerfile, Host or Intermediate container?从 Dockerfile、主机或中间容器执行 RUN 命令在哪里?
【发布时间】:2017-05-09 16:23:00
【问题描述】:

假设这是一个 Dockerfile 的示例

FROM ubuntu:12.04

MAINTAINER Kimbro Staken version: 0.1

RUN apt-get update && apt-get install -y apache2 && apt-get clean && rm -rf /var/lib/apt/lists/*

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2

EXPOSE 80

CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]

这是我的问题:我是在主机 PC 上运行 RUN apt-get update 还是创建一个中间容器并在其上运行然后提交它。

【问题讨论】:

    标签: docker dockerfile


    【解决方案1】:

    它将创建中间容器,运行所有使用 RUN 指定的命令,然后提交。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-21
    • 2021-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-14
    • 2020-07-28
    相关资源
    最近更新 更多