launch a CAT command unix into Dockerfile

darkomen picture darkomen · Nov 1, 2016 · Viewed 22.9k times · Source

I would like to launch this vagrant command cat(run perfectly!) to provisionning my container with a Dockerfile :

# Configure Virtualenvwrapper.
RUN cat <<EOF >> /home/docker/.bashrc
# Virtualenvwrapper configuration.
export WORKON_HOME=\$HOME/.virtualenvs
export PROJECT_HOME=\$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
EOF

But I have this error return when I launch my building image docker :

 ---> 40f9ed8e187d
Removing intermediate container 85f6c8536520
Step 69 : RUN cat <<EOF >> /home/docker/.bashrc
 ---> Running in dcbb3d441f79
 ---> 78acd9c2e5d5
Removing intermediate container dcbb3d441f79
Step 70 : EXPORT
Unknown instruction: EXPORT

What is the trick for run a cat command unix into image with Dockerfile ?

Answer

w1100n picture w1100n · Jan 14, 2019

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