-
Notifications
You must be signed in to change notification settings - Fork 114
/
Dockerfile.gnu
50 lines (40 loc) · 1.48 KB
/
Dockerfile.gnu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ----------------------------------------------------------------------
# Build ED2 model
# ----------------------------------------------------------------------
FROM ubuntu:22.04 AS build
# Some variables that can be used to set control the docker build
ARG ED2_KIND=E
# environment variables controlling the build
ENV FC_TYPE=GNU \
ED2_KIND=${ED2_KIND} \
TZ=America/Chicago \
DEBIAN_FRONTEND=noninteractive
# install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
gfortran \
libhdf5-openmpi-dev \
&& rm -rf /var/lib/apt/lists/*
# copy the source only, this prevents a full rebuild in case of changes to Dockerfile or non source files
COPY BRAMS /ED2/BRAMS
COPY ED /ED2/ED
COPY EDR /ED2/EDR
COPY RAPP /ED2/RAPP
COPY Ramspost /ED2/Ramspost
WORKDIR /ED2/ED/build
RUN ./install.sh -k ${ED2_KIND} -g -p docker.gnu
RUN if [ -e ed_*-opt ]; then mv ed_*-opt ed2; else mv ed_*-dbg ed2; fi
########################################################################
# ----------------------------------------------------------------------
# Minimal image with just ED2 model
# ----------------------------------------------------------------------
FROM ubuntu:22.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libhdf5-openmpi-103 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /data
COPY --from=build /ED2/ED/build/ed2 /usr/bin
CMD ["/usr/bin/ed2"]