Skip to content

Commit

Permalink
Fix Dockerfile to prevent Mamba install failing
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-l-p committed Apr 10, 2024
1 parent 017583b commit 2c01874
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Dockerfile
Expand Up @@ -17,38 +17,32 @@ RUN yum groupinstall "Development Tools" -y --nogpgcheck && \
yum install -y --nogpgcheck mesa-libGL libXt libXt-devel wget gcc-gfortran lapack vim tmux && \
yum clean all

# Install Mamba
# Swapped from Conda to Mamba due to Github runner memory constraint
# Install Mamba - swapped from Conda to Mamba due to Github runner memory constraint
RUN wget --no-check-certificate https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh -O /mamba.sh && \
chmod +x /mamba.sh && \
/mamba.sh -b -p /mamba/ && \
rm /mamba.sh && hash -r

ADD / /sharpy_dir/

# Update mamba and make it run with no user interaction
# Cleanup mamba installation
RUN mamba init bash
RUN mamba config --set always_yes yes --set changeps1 no
RUN mamba update -q conda
RUN mamba config --set auto_activate_base false
RUN mamba env create -f /sharpy_dir/utils/environment.yml
#RUN mamba clean -afy
RUN find /mamba/ -follow -type f -name '*.a' -delete
RUN find /mamba/ -follow -type f -name '*.pyc' -delete
RUN find /mamba/ -follow -type f -name '*.js.map' -delete

#COPY /utils/docker/* /root/
# Initialise mamba installation
RUN mamba init bash && \
mamba update -q conda && \
mamba env create -f /sharpy_dir/utils/environment.yml && \
find /mamba/ -follow -type f -name '*.a' -delete && \
find /mamba/ -follow -type f -name '*.pyc' -delete && \
find /mamba/ -follow -type f -name '*.js.map' -delete

RUN ln -s /sharpy_dir/utils/docker/* /root/

RUN cd sharpy_dir && \
mamba activate sharpy && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
CXX=g++ FC=gfortran cmake .. && make install -j 2 && \
CXX=g++ FC=gfortran cmake .. && make install -j 4 && \
cd .. && \
pip install . && \
rm -rf build

ENTRYPOINT ["/bin/bash", "--init-file", "/root/bashrc"]
ENTRYPOINT ["/bin/bash", "--init-file", "/root/bashrc"]

0 comments on commit 2c01874

Please sign in to comment.