summaryrefslogtreecommitdiff
path: root/.nea/docker
diff options
context:
space:
mode:
Diffstat (limited to '.nea/docker')
-rw-r--r--.nea/docker/Dockerfile.slim51
-rw-r--r--.nea/docker/entrypoint.sh22
2 files changed, 73 insertions, 0 deletions
diff --git a/.nea/docker/Dockerfile.slim b/.nea/docker/Dockerfile.slim
new file mode 100644
index 0000000..ebfae15
--- /dev/null
+++ b/.nea/docker/Dockerfile.slim
@@ -0,0 +1,51 @@
+FROM docker.oecd-nea.org/dragon/5.1/ubuntu:24.04
+
+COPY ./.nea/docker/entrypoint.sh /entrypoint.sh
+
+ENV DRAGON_HOME=/dragon
+ENV DRAGON_CODE_DIR=$DRAGON_HOME/5.1
+
+ENV HDF5_INC=/usr/include/hdf5/serial
+ENV HDF5_API=/usr/lib/x86_64-linux-gnu/hdf5/serial
+ENV FORTRANPATH=/usr/lib/gcc/x86_64-linux-gnu/13
+
+RUN AG="env DEBIAN_FRONTEND=noninteractive apt-get -yq" && \
+ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
+ # NEA special for our internal apt mirrors
+ cp /etc/apt/sources.list.d/ubuntu.sources /ubuntu.sources.original && \
+ sed -i 's|http://archive.ubuntu.com|http://debmirror.nea.fr:9999/archive.ubuntu.com|g' /etc/apt/sources.list.d/ubuntu.sources && \
+ sed -i 's|http://security.ubuntu.com|http://debmirror.nea.fr:9999/security.ubuntu.com|g' /etc/apt/sources.list.d/ubuntu.sources && \
+ $AG update && \
+ $AG upgrade --no-install-recommends && \
+ $AG install --no-install-recommends openssl git git-lfs wget curl make gfortran python3 python3-dev python3-numpy python3-setuptools libhdf5-serial-dev libomp-dev && \
+ $AG autoremove && \
+ $AG autoclean && \
+ $AG clean && \
+ # Put the normal apt sources back after installing deps
+ mv /ubuntu.sources.original /etc/apt/sources.list.d/ubuntu.sources && \
+ openssl s_client -showcerts -connect git.oecd-nea.org:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /ca.crt && \
+ git config --global http.sslCAInfo /ca.crt && \
+ mkdir ${DRAGON_HOME} && cd ${DRAGON_HOME} && \
+ git clone https://git.oecd-nea.org/dragon/5.1 && \
+ cd ${DRAGON_CODE_DIR} && \
+ # to keep it slim we can remove the .git folder, and the data folders
+ rm -rf .git Donjon/data Dragon/data Trivac/data doc && \
+ cd ${DRAGON_CODE_DIR}/Donjon && \
+ make hdf5=1 openmp=1 && \
+ # this doesn't remove the binaries, just the *.o and the *.a and *.mod files
+ make clean && \
+ cd ../PyGan && \
+ make hdf5=1 openmp=1 && \
+ # this doesn't remove the binaries, just the *.o and the *.a and *.mod files
+ make clean && \
+ cd ../Ganlib && \
+ ./rganlib -q testgan1.x2m && \
+ ./rganlib -q testgan2.x2m && \
+ ./rganlib -q testgan3.x2m && \
+ chmod +x /entrypoint.sh
+
+# ENV DRAGON_LIB_DIR=$DRAGON_HOME/libraries/l_endian
+
+WORKDIR /dragon/5.1/
+
+ENTRYPOINT [ "/entrypoint.sh" ]
diff --git a/.nea/docker/entrypoint.sh b/.nea/docker/entrypoint.sh
new file mode 100644
index 0000000..416fac5
--- /dev/null
+++ b/.nea/docker/entrypoint.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+RED='\033[1;91m'
+GREEN='\033[1;92m'
+BLUE='\033[1;94m'
+NC='\033[0m'
+
+
+tryit(){
+ "$@"
+ local status=$?
+ if [ $status -ne 0 ]; then
+ echo -e "${RED}Error occurred with $1 ${NC}" >&2
+ exit $status
+ fi
+ return $status
+}
+
+
+# run donjon as the default entrypoint, as donjon can run dragon
+cd Donjon
+tryit ./rdonjon $@