1
- FROM debian:12
1
+ FROM debian:12-slim
2
2
LABEL maintainer="Michael Kavulich <kavulich@ucar.edu>"
3
3
4
4
# arguments that can be passed in
5
5
ARG PR_NUMBER
6
+ # build variables
7
+ ARG GNU_VERSION=12
8
+ ARG VERBOSE=0
9
+
6
10
7
11
# Set up base OS environment
8
12
RUN apt-get -y update
9
13
10
14
# Get "essential" tools and libraries
11
- RUN apt-get -y install build-essential \
12
- && apt-get -y install cmake cmake-curses-gui curl git file gfortran-12 ksh m4 python3 tcsh time wget vim emacs-nox \
13
- && apt-get -y install libnetcdf-pnetcdf-19 libnetcdff7 libnetcdf-dev libnetcdff-dev libxml2 \
14
- && apt-get -y install python3-pip python3.11-venv python3-netcdf4 \
15
- && apt-get -y install openmpi-bin libopenmpi-dev
15
+ RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
16
+ build-essential \
17
+ cmake \
18
+ cmake-curses-gui \
19
+ curl \
20
+ git \
21
+ file \
22
+ gfortran-$GNU_VERSION \
23
+ ksh \
24
+ m4 \
25
+ tcsh \
26
+ time \
27
+ wget \
28
+ vim \
29
+ emacs-nox \
30
+ python3 \
31
+ python3-pip \
32
+ python3.11-venv \
33
+ python3-netcdf4 \
34
+ libnetcdf-pnetcdf-19 \
35
+ libnetcdff7 \
36
+ libnetcdf-dev \
37
+ libnetcdff-dev \
38
+ libxml2 \
39
+ openmpi-bin \
40
+ libopenmpi-dev \
41
+ && apt-get clean \
42
+ && rm -rf /var/lib/apt/lists/*
43
+
16
44
RUN ln -s /usr/bin/python3 /usr/bin/python
45
+ RUN ln -s /usr/bin/gfortran-$GNU_VERSION /usr/bin/gfortran
17
46
18
47
# Set up python needed packages, preferred Docker method is apt-get but
19
48
# f90nml can't be installed for debian that way
20
49
RUN pip install f90nml --break-system-packages
21
50
22
51
# Compiler environment variables
23
- ENV CC=/usr/bin/ gcc
24
- ENV FC=/usr/bin/ gfortran
25
- ENV CXX=/usr/bin/ g++
26
- ENV F77=/usr/bin/ gfortran
27
- ENV F90=/usr/bin/ gfortran
52
+ ENV CC=gcc
53
+ ENV FC=gfortran
54
+ ENV CXX=g++
55
+ ENV F77=gfortran
56
+ ENV F90=gfortran
28
57
29
58
# Other necessary environment variables
30
59
ENV LD_LIBRARY_PATH=/usr/lib/
@@ -47,24 +76,24 @@ WORKDIR /home
47
76
ENV NCEPLIBS_DIR=/comsoftware/nceplibs
48
77
49
78
RUN mkdir -p $NCEPLIBS_DIR/src && cd $NCEPLIBS_DIR/src \
50
- && git clone -b v2.4.1 --recursive https://github.com/NOAA-EMC/NCEPLIBS-bacio \
51
- && mkdir NCEPLIBS-bacio/build && cd NCEPLIBS-bacio/build \
52
- && cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
53
- && make VERBOSE=1 -j \
54
- && make install
79
+ && git clone -b v2.4.1 --depth 1 --recursive https://github.com/NOAA-EMC/NCEPLIBS-bacio \
80
+ && mkdir NCEPLIBS-bacio/build && cd NCEPLIBS-bacio/build \
81
+ && cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
82
+ && make VERBOSE=$VERBOSE -j \
83
+ && make install
55
84
56
85
RUN cd $NCEPLIBS_DIR/src \
57
- && git clone -b v2.3.3 --recursive https://github.com/NOAA-EMC/NCEPLIBS-sp \
86
+ && git clone -b v2.3.3 --depth 1 -- recursive https://github.com/NOAA-EMC/NCEPLIBS-sp \
58
87
&& mkdir NCEPLIBS-sp/build && cd NCEPLIBS-sp/build \
59
88
&& cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
60
- && make VERBOSE=1 -j \
89
+ && make VERBOSE=$VERBOSE -j \
61
90
&& make install
62
91
63
92
RUN cd $NCEPLIBS_DIR/src \
64
- && git clone -b v2.11.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS-w3emc \
93
+ && git clone -b v2.11.0 --depth 1 -- recursive https://github.com/NOAA-EMC/NCEPLIBS-w3emc \
65
94
&& mkdir NCEPLIBS-w3emc/build && cd NCEPLIBS-w3emc/build \
66
95
&& cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
67
- && make VERBOSE=1 -j \
96
+ && make VERBOSE=$VERBOSE -j \
68
97
&& make install
69
98
70
99
ENV bacio_ROOT=/comsoftware/nceplibs
@@ -81,17 +110,14 @@ RUN if [ -z "$PR_NUMBER" ]; then \
81
110
&& cd ccpp-scm \
82
111
&& git fetch origin pull/${PR_NUMBER}/head:test_pr \
83
112
&& git checkout test_pr \
84
- && git submodule update --init --recursive; \
113
+ && git submodule update --init --recursive --depth 1 ; \
85
114
fi
86
115
87
116
RUN mkdir /comsoftware/ccpp-scm/scm/bin \
88
117
&& cd /comsoftware/ccpp-scm/scm/bin \
89
118
&& cmake ../src \
90
119
&& make -j
91
120
92
- RUN cd /comsoftware/ccpp-scm/ \
93
- && ./contrib/get_all_static_data.sh \
94
- && ./contrib/get_thompson_tables.sh
95
121
96
122
# The analysis scripts have options for using LaTeX when making figure labels.
97
123
# If you would like to install LaTeK, uncomment the section below.
@@ -109,4 +135,11 @@ ENV SCM_ROOT=/comsoftware/ccpp-scm/
109
135
# For interactive use, vim mouse settings are infuriating
110
136
RUN echo "set mouse=" > ~/.vimrc
111
137
112
- ENTRYPOINT ["sh" , "-c" , "./contrib/get_aerosol_climo.sh && cd /comsoftware/ccpp-scm/scm/bin" ]
138
+ # only download test data when PR is being tested
139
+ ENTRYPOINT ["sh" , "-c" , "\
140
+ if [ -n \" $PR_NUMBER\" ]; then \
141
+ ./contrib/get_aerosol_climo.sh && \
142
+ ./contrib/get_all_static_data.sh && \
143
+ ./contrib/get_thompson_tables.sh; \
144
+ fi && \
145
+ cd /comsoftware/ccpp-scm/scm/bin" ]
0 commit comments