Skip to content

Commit 128d5f9

Browse files
authored
Merge pull request #637 from DeepRank/529_fix_dockerfile_add_test_gcroci2
fix: dockerfile image build
2 parents 3a4942f + 928c67b commit 128d5f9

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

Dockerfile

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
11
# Pull base image
2-
FROM --platform=linux/x86_64 condaforge/miniforge3:23.3.1-1
2+
FROM --platform=linux/amd64 ubuntu:22.04
3+
4+
ARG MINIFORGE_NAME=Miniforge3
5+
ARG MINIFORGE_VERSION=24.3.0-0
6+
ARG TARGETPLATFORM
7+
8+
ENV CONDA_DIR=/opt/conda
9+
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
10+
ENV PATH=${CONDA_DIR}/bin:${PATH}
11+
12+
RUN \
13+
## Install apt dependencies
14+
apt-get update && \
15+
apt-get install --no-install-recommends --yes \
16+
wget bzip2 unzip ca-certificates \
17+
git && \
18+
## Download and install Miniforge
19+
wget --no-hsts --quiet https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/${MINIFORGE_NAME}-${MINIFORGE_VERSION}-Linux-x86_64.sh -O /tmp/miniforge.sh && \
20+
/bin/bash /tmp/miniforge.sh -b -p ${CONDA_DIR} && \
21+
rm /tmp/miniforge.sh && \
22+
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> /etc/skel/.bashrc && \
23+
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc
324

4-
# Add files
5-
ADD ./tutorials /home/deeprank2/tutorials
625
ADD ./env/deeprank2.yml /home/deeprank2
726

827
RUN \
9-
# Install dependencies and package
10-
apt update -y && \
11-
apt install unzip -y && \
12-
## GCC
13-
apt install -y gcc && \
1428
## Create the environment and install the dependencies
1529
mamba env create -f /home/deeprank2/deeprank2.yml && \
30+
conda install -n deeprank2 conda-forge::gcc && \
1631
## Activate the environment and install pip packages
17-
/opt/conda/bin/conda run -n deeprank2 pip install deeprank2 && \
32+
conda run -n deeprank2 pip install deeprank2 && \
1833
## Activate the environment automatically when entering the container
1934
echo "source activate deeprank2" >~/.bashrc && \
2035
# Get the data for running the tutorials
2136
if [ -d "/home/deeprank2/tutorials/data_raw" ]; then rm -Rf /home/deeprank2/tutorials/data_raw; fi && \
2237
if [ -d "/home/deeprank2/tutorials/data_processed" ]; then rm -Rf /home/deeprank2/tutorials/data_processed; fi && \
2338
wget https://zenodo.org/records/8349335/files/data_raw.zip && \
2439
unzip data_raw.zip -d data_raw && \
25-
mv data_raw /home/deeprank2/tutorials
40+
mv data_raw /home/deeprank2/tutorials && \
41+
apt-get clean && \
42+
rm -rf /var/lib/apt/lists/* && \
43+
conda clean --tarballs --index-cache --packages --yes && \
44+
find ${CONDA_DIR} -follow -type f -name '*.a' -delete && \
45+
find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete && \
46+
conda clean --force-pkgs-dirs --all --yes
47+
48+
ADD ./tutorials /home/deeprank2/tutorials
2649

2750
ENV PATH /opt/conda/envs/deeprank2/bin:$PATH
2851

0 commit comments

Comments
 (0)