FROM jedbrown/mpich-ccache
USER root

# PACKAGE INSTALL
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install software-properties-common
RUN add-apt-repository universe
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install emacs
RUN apt-get -y install python3
RUN apt-get -y install valgrind
RUN apt-get -y install cmake

# ENV VARIABLES
ENV PETSC_DIR="/petsc"
ENV PETSC_ARCH="arch-linux-c-debug"

# BASH SETTINGS
RUN echo 'alias ebp="emacs ~/.bashrc"' >> ~/.bashrc && \
echo 'alias sbp="source ~/.bashrc"' >> ~/.bashrc && \
echo 'alias ..="cd .."' >> ~/.bashrc && \
echo 'alias cd..="cd .."' >> ~/.bashrc && \
echo 'alias cd-="cd -"' >> ~/.bashrc && \
echo 'alias cdr="cd ~/"' >> ~/.bashrc && \
echo 'alias cdp="cd ${PETSC_DIR}"' >> ~/.bashrc && \
echo 'alias h="history"' >> ~/.bashrc && \
echo 'alias gs="git status"' >> ~/.bashrc && \
echo 'alias gsu="git status -uno"' >> ~/.bashrc && \
echo 'alias gau="git add -u"' >> ~/.bashrc && \
echo 'alias gcm="git checkout master"' >> ~/.bashrc && \
echo 'alias gds="git diff --staged"' >> ~/.bashrc && \
echo 'alias python="python3"' >> ~/.bashrc && \
echo 'force_color_prompt=yes' >> ~/.bashrc && \
echo 'export PATH="/usr/lib/ccache:$PATH"' >>  ~/.bashrc

# EMACS
RUN "/usr/sbin/update-ccache-symlinks"
WORKDIR /petsc
ENTRYPOINT echo "Valgrind Container Initialized" && /bin/bash
