Commit 91a7b8bd authored by Adam Fekete's avatar Adam Fekete
Browse files

multi-stage build

parent 74b8a018
# https://github.com/jupyter/docker-stacks # https://github.com/jupyter/docker-stacks
# https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html # https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html
FROM jupyter/scipy-notebook
LABEL maintainer="Gian-Marco Rignanese <gian-marco.rignanese@uclouvain.be>"
# # Fix DL4006 FROM jupyter/scipy-notebook AS builder
# SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Abinit installation # Abinit installation
# =================== # ===================
...@@ -23,24 +19,46 @@ RUN apt-get update \ ...@@ -23,24 +19,46 @@ RUN apt-get update \
liblapack-dev libblas-dev \ liblapack-dev libblas-dev \
libhdf5-dev libnetcdf-dev libnetcdff-dev libpnetcdf-dev libxc-dev \ libhdf5-dev libnetcdf-dev libnetcdff-dev libpnetcdf-dev libxc-dev \
libfftw3-dev libxml2-dev \ libfftw3-dev libxml2-dev \
slurmd slurm-client slurmctld \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /opt WORKDIR /tmp
ARG abinit_version="9.4.0" ARG abinit_version="9.4.0"
COPY configs/abinit_config.ac9 /opt/abinit-${abinit_version}/build/abinit_config.ac9 COPY configs/abinit_config.ac9 /tmp/abinit-${abinit_version}/build/abinit_config.ac9
RUN wget -k "https://www.abinit.org/sites/default/files/packages/abinit-${abinit_version}.tar.gz" \ RUN wget -k "https://www.abinit.org/sites/default/files/packages/abinit-${abinit_version}.tar.gz" \
&& tar xzf abinit-${abinit_version}.tar.gz \ && tar xzf abinit-${abinit_version}.tar.gz \
&& cd abinit-${abinit_version} \ && cd abinit-${abinit_version} \
&& cd build \ && cd build \
&& ../configure --with-config-file='abinit_config.ac9' \ && ../configure --with-config-file='abinit_config.ac9' --prefix=/opt/abinit \
&& make -j4 \ && make -j4 \
&& make install \ && make install
&& rm /opt/abinit-${abinit_version}.tar.gz \
# && rm -rf /opt/abinit-${abinit_version}
&& fix-permissions "/opt/abinit-${abinit_version}" FROM jupyter/scipy-notebook
LABEL maintainer="Gian-Marco Rignanese <gian-marco.rignanese@uclouvain.be>"
# Abinit installation
# ===================
# # 1. MPI libraries - choice for Open MPI: mpi-default libopenmpi
# # 2. math libraries - choice for lapack and blas: liblapack libblas
# # 3. mandatory libraries: libhdf5 libnetcdf libnetcdff libpnetcdf libxc libfftw3 libxml2
USER root
WORKDIR /opt/abinit
RUN apt-get update \
&& apt install -y --no-install-recommends \
mpi-default-bin openmpi-bin libopenmpi3 \
liblapack3 libblas3 \
libhdf5-103 libnetcdf15 libnetcdff7 libpnetcdf0d libxc5 \
libfftw3-bin libxml2 \
# slurmd slurm-client slurmctld \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/abinit .
RUN fix-permissions "/opt/abinit"
USER $NB_UID USER $NB_UID
...@@ -62,17 +80,20 @@ RUN conda install --quiet --yes \ ...@@ -62,17 +80,20 @@ RUN conda install --quiet --yes \
&& fix-permissions "${CONDA_DIR}" \ && fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}" && fix-permissions "/home/${NB_USER}"
# Pseudo-dojo # # Pseudo-dojo
USER root # USER root
WORKDIR /opt # WORKDIR /opt
RUN git clone --depth 1 https://github.com/abinit/pseudo_dojo.git \ # RUN git clone --depth 1 https://github.com/abinit/pseudo_dojo.git \
&& cd pseudo_dojo \ # && cd pseudo_dojo \
&& fix-permissions "/opt/pseudo_dojo" # && fix-permissions "/opt/pseudo_dojo"
# USER $NB_UID
# RUN pip install -e pseudo_dojo
USER $NB_UID
RUN pip install -e pseudo_dojo ENV PATH=/opt/abinit/bin:$PATH
USER $NB_UID USER $NB_UID
WORKDIR $HOME WORKDIR $HOME
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment