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

multi-stage build

parent 74b8a018
# https://github.com/jupyter/docker-stacks
# 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
# SHELL ["/bin/bash", "-o", "pipefail", "-c"]
FROM jupyter/scipy-notebook AS builder
# Abinit installation
# ===================
......@@ -23,24 +19,46 @@ RUN apt-get update \
liblapack-dev libblas-dev \
libhdf5-dev libnetcdf-dev libnetcdff-dev libpnetcdf-dev libxc-dev \
libfftw3-dev libxml2-dev \
slurmd slurm-client slurmctld \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt
WORKDIR /tmp
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" \
&& tar xzf abinit-${abinit_version}.tar.gz \
&& cd abinit-${abinit_version} \
&& cd build \
&& ../configure --with-config-file='abinit_config.ac9' \
&& ../configure --with-config-file='abinit_config.ac9' --prefix=/opt/abinit \
&& make -j4 \
&& make install \
&& rm /opt/abinit-${abinit_version}.tar.gz \
# && rm -rf /opt/abinit-${abinit_version}
&& fix-permissions "/opt/abinit-${abinit_version}"
&& make install
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
......@@ -62,17 +80,20 @@ RUN conda install --quiet --yes \
&& fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}"
# Pseudo-dojo
USER root
WORKDIR /opt
# # Pseudo-dojo
# USER root
# WORKDIR /opt
RUN git clone --depth 1 https://github.com/abinit/pseudo_dojo.git \
&& cd pseudo_dojo \
&& fix-permissions "/opt/pseudo_dojo"
# RUN git clone --depth 1 https://github.com/abinit/pseudo_dojo.git \
# && cd 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
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