title: How to use bash profile in dockerfile
body: <p>I am trying to build an image using dockerfile.
  The commands in the dockerfile looks something like these:</p>
  
  <pre><code>FROM ubuntu:16.04
  :
  :
  RUN pip3 install virtualenvwrapper  
  RUN echo '# Python virtual environment wrapper' &gt;&gt; ~/.bashrc
  RUN echo 'export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3' &gt;&gt; ~/.bashrc
  RUN echo 'export WORKON_HOME=$HOME/.virtualenvs' &gt;&gt; ~/.bashrc
  RUN echo 'source /usr/local/bin/virtualenvwrapper.sh' &gt;&gt; ~/.bashrc
  </code></pre>
  
  <p>After these commands, I will use virtualenvwrapper commands to make some virtualenvs.</p>
  
  <p>If I had only environment variables to deal with in <code>~/.bashrc</code>, I would have used <code>ARG</code> or <code>ENV</code> to set them up. </p>
  
  <blockquote>
    <p>But now I also have other shell script files like <code>virtualenvwrapper.sh</code> the will be setting some of their own variables. </p>
  </blockquote>
  
  <p>Also, <code>RUN source ~/.bashrc</code> is not working (source not found).</p>
  
  <p>What should I do? </p>