|
1 | 1 | # 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 |
3 | 24 |
|
4 |
| -# Add files |
5 |
| -ADD ./tutorials /home/deeprank2/tutorials |
6 | 25 | ADD ./env/deeprank2.yml /home/deeprank2
|
7 | 26 |
|
8 | 27 | RUN \
|
9 |
| - # Install dependencies and package |
10 |
| - apt update -y && \ |
11 |
| - apt install unzip -y && \ |
12 |
| - ## GCC |
13 |
| - apt install -y gcc && \ |
14 | 28 | ## Create the environment and install the dependencies
|
15 | 29 | mamba env create -f /home/deeprank2/deeprank2.yml && \
|
| 30 | + conda install -n deeprank2 conda-forge::gcc && \ |
16 | 31 | ## 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 && \ |
18 | 33 | ## Activate the environment automatically when entering the container
|
19 | 34 | echo "source activate deeprank2" >~/.bashrc && \
|
20 | 35 | # Get the data for running the tutorials
|
21 | 36 | if [ -d "/home/deeprank2/tutorials/data_raw" ]; then rm -Rf /home/deeprank2/tutorials/data_raw; fi && \
|
22 | 37 | if [ -d "/home/deeprank2/tutorials/data_processed" ]; then rm -Rf /home/deeprank2/tutorials/data_processed; fi && \
|
23 | 38 | wget https://zenodo.org/records/8349335/files/data_raw.zip && \
|
24 | 39 | 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 |
26 | 49 |
|
27 | 50 | ENV PATH /opt/conda/envs/deeprank2/bin:$PATH
|
28 | 51 |
|
|
0 commit comments