I am trying to build an image using dockerfile. The commands in the dockerfile looks something like these:
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
After these commands, I will use virtualenvwrapper commands to make some virtualenvs.
If I had only environment variables to deal with in ~/.bashrc
, I would have used ARG
or ENV
to set them up.
But now I also have other shell script files like
virtualenvwrapper.sh
the will be setting some of their own variables.
Also, RUN source ~/.bashrc
is not working (source not found).
What should I do?