Skip to content

Commit

Permalink
write conda activate stuff to /etc/bash.bashrc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdjscott committed Mar 3, 2024
1 parent a18c4ad commit 42bc061
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /miniconda.sh \
&& bash /miniconda.sh -b -p /opt/miniconda3 \
&& rm -f /miniconda3 \
&& echo "export PATH=/opt/miniconda3/bin:\${PATH}" > /etc/profile.d/miniconda.sh \
&& echo ". \$(conda info --base)/etc/profile.d/conda.sh" >> /etc/profile.d/miniconda.sh
&& echo "export PATH=/opt/miniconda3/bin:\${PATH}" >> /etc/bash.bashrc \
&& echo ". \$(conda info --base)/etc/profile.d/conda.sh" >> /etc/bash.bashrc

# copy the repo source (e.g. notebooks) to the container image
ARG ML101_HASH="dfb7a172a49f76f7c0ab1f9a96fa9b92aafaac96"
RUN git clone https://github.com/nesi/sklearn_tutorial.git /opt/sklearn_tutorial \
&& cd /opt/sklearn_tutorial \
&& git checkout $ML101_HASH \
&& rm -rf /opt/sklearn_tutorial/.git \
&& . /etc/profile.d/miniconda.sh \
&& export PATH=/opt/miniconda3/bin:${PATH} \
&& . $(conda info --base)/etc/profile.d/conda.sh \
&& conda env create -f /opt/sklearn_tutorial/environment.yml -p /var/lib/skl_tut \
&& echo "conda activate /var/lib/skl_tut" >> /etc/profile.d/miniconda.sh \
&& echo "conda activate /var/lib/skl_tut" >> /etc/bash.bashrc \
&& conda clean -afy

0 comments on commit 42bc061

Please sign in to comment.