我正在构建一个 Dockerfile,我想在构建它时显示一些帮助消息。
我也尝试过,RUN echo "installing this"但正如预期的那样,它不起作用。
那么,如何docker build在安静模式下运行命令时显示帮助消息以及如果可能的话。
我正在尝试使用 dockerfile 构建图像。dockerfile 中的命令如下所示:
FROM ubuntu:16.04
:
:
RUN pip3 install virtualenvwrapper
RUN echo '# Python virtual environment wrapper' >> ~/.bashrc
RUN echo 'export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3' >> ~/.bashrc
RUN echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc
RUN echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
在这些命令之后,我将使用 virtualenvwrapper 命令来创建一些 virtualenv。
如果我只有环境变量要处理~/.bashrc,我会使用ARGorENV来设置它们。
但现在我还有其他 shell 脚本文件,例如
virtualenvwrapper.sh将设置一些自己的变量。
另外,RUN source ~/.bashrc不起作用(未找到来源)。
我应该怎么办?