~/.bashrc is only executed for login shell. If you want it to be executed in the next RUN commands, you must specify it explicitly, like this:
~/.bashrc
RUN bash -l -c '...'
or
RUN . ~/.bashrc; ...