launch a CAT command unix into Dockerfile launch a CAT command unix into Dockerfile unix unix

launch a CAT command unix into Dockerfile


Based on this comment to an issue posted on Github, this works:

RUN echo 'All of your\n\multiline that you ever wanted\n\into a dockerfile\n'\>> /etc/example.conf


Dockerfiles are not batch files. Every line/command is isolated and committed.

Just put the contents into a file and ADD/COPY it. If you need to customize it, SED it. Or if you really, really, really want to CAT into a file -- put it in a real batch file, then ADD/COPY it, then RUN it.

Also, less lines = less layers. 70 Steps? Yowzers.


You can write it this way:

RUN echo "# Virtualenvwrapper configuration." >> /home/docker/.bashrc && \    echo "export WORKON_HOME=\$HOME/.virtualenvs" >> /home/docker/.bashrc && \    echo "export PROJECT_HOME=\$HOME/Devel" >> /home/docker/.bashrc && \    echo "source /usr/local/bin/virtualenvwrapper.sh" >> /home/docker/.bashrc