forked from NCAR/WRF_DOCKER
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_regtest
116 lines (112 loc) · 4.41 KB
/
Dockerfile_regtest
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#
FROM centos:latest
MAINTAINER John Exby <exby@ucar.edu>
#
RUN curl -SL https://ral.ucar.edu/sites/default/files/public/projects/ncar-docker-wrf/ucar-bsd-3-clause-license.pdf > /UCAR-BSD-3-Clause-License.pdf
#
ENV WRF_VERSION 4.0.3
ENV WPS_VERSION 4.0.2
ENV NML_VERSION 4.0.2
#
# Set up base OS environment
#
RUN yum -y update
RUN yum -y install file gcc gcc-gfortran gcc-c++ glibc.i686 libgcc.i686 libpng-devel jasper \
jasper-devel hostname m4 make perl tar bash tcsh time wget which zlib zlib-devel \
openssh-clients openssh-server net-tools fontconfig libgfortran libXext libXrender ImageMagick sudo epel-release
#
# now get 3rd party EPEL builds of netcdf and openmpi dependencies
RUN yum -y install netcdf-openmpi-devel.x86_64 netcdf-fortran-openmpi-devel.x86_64 \
netcdf-fortran-openmpi.x86_64 hdf5-openmpi.x86_64 openmpi.x86_64 openmpi-devel.x86_64 \
&& yum clean all
#
RUN mkdir -p /var/run/sshd \
&& ssh-keygen -A \
&& sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config \
&& sed -i 's/#RSAAuthentication yes/RSAAuthentication yes/g' /etc/ssh/sshd_config \
&& sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
#
RUN groupadd wrf -g 9999
RUN useradd -u 9999 -g wrf -G wheel -M -d /wrf wrfuser
#
RUN mkdir /wrf \
&& chown -R wrfuser:wrf /wrf \
&& chmod 6755 /wrf
RUN mkdir -p /wrf/WPS_GEOG /wrf/wrfinput /wrf/wrfoutput \
&& chown -R wrfuser:wrf /wrf /wrf/WPS_GEOG /wrf/wrfinput /wrf/wrfoutput /usr/local \
&& chmod 6755 /wrf /wrf/WPS_GEOG /wrf/wrfinput /wrf/wrfoutput /usr/local
# Set environment for interactive container shells
#
RUN echo export LDFLAGS="-lm" >> /etc/bashrc \
&& echo export NETCDF=/wrf/netcdf_links >> /etc/bashrc \
&& echo export JASPERINC=/usr/include/jasper/ >> /etc/bashrc \
&& echo export JASPERLIB=/usr/lib64/ >> /etc/bashrc \
&& echo export LD_LIBRARY_PATH="/usr/lib64/openmpi/lib" >> /etc/bashrc \
&& echo export PATH=".:/usr/lib64/openmpi/bin:$PATH" >> /etc/bashrc \
&& echo setenv LDFLAGS "-lm" >> /etc/csh.cshrc \
&& echo setenv NETCDF "/wrf/netcdf_links" >> /etc/csh.cshrc \
&& echo setenv JASPERINC "/usr/include/jasper/" >> /etc/csh.cshrc \
&& echo setenv JASPERLIB "/usr/lib64/" >> /etc/csh.cshrc \
&& echo setenv LD_LIBRARY_PATH "/usr/lib64/openmpi/lib" >> /etc/csh.cshrc \
&& echo setenv PATH ".:/usr/lib64/openmpi/bin:$PATH" >> /etc/csh.cshrc
#
#
RUN mkdir /wrf/.ssh ; echo "StrictHostKeyChecking no" > /wrf/.ssh/config
COPY default-mca-params.conf /wrf/.openmpi/mca-params.conf
RUN mkdir -p /wrf/.openmpi
RUN chown -R wrfuser:wrf /wrf/
# RUN echo "root ALL=(ALL) ALL" >> /etc/sudoers
#
#
# all root steps completed above, now below as regular userID wrfuser
USER wrfuser
WORKDIR /wrf
#
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_low_res_mandatory.tar.gz | tar -xzC /wrf/WPS_GEOG
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/TUTORIAL_DATA/colorado_march16.new.tar.gz | tar -xzC /wrf/wrfinput
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/src/namelists_v$NML_VERSION.tar.gz | tar -xzC /wrf/wrfinput
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/TUTORIAL_DATA/WRF_NCL_scripts.tar.gz | tar -xzC /wrf
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/dave/data_v04.08.tar.gz | tar -xzC /wrf
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/dave/nml.tar.gz | tar -xzC /wrf
#
RUN curl -SL http://www2.mmm.ucar.edu/wrf/dave/script.tar | tar -xC /wrf
#
# Download NCL
#
RUN curl -SL https://ral.ucar.edu/sites/default/files/public/projects/ncar-docker-wrf/nclncarg-6.3.0.linuxcentos7.0x8664nodapgcc482.tar.gz | tar zxC /usr/local
ENV NCARG_ROOT /usr/local
#
#
# Download wrf and wps source, Version 4.0 and later
RUN curl -SL https://github.com/wrf-model/WPS/archive/v$WPS_VERSION.tar.gz | tar zxC /wrf \
&& curl -SL https://github.com/wrf-model/WRF/archive/v$WRF_VERSION.tar.gz | tar zxC /wrf
RUN mv /wrf/WPS-$WPS_VERSION /wrf/WPS
RUN mv /wrf/WRF-$WRF_VERSION /wrf/WRF
ENV NETCDF_classic 1
#
#
RUN mkdir netcdf_links \
&& ln -sf /usr/include/openmpi-x86_64/ netcdf_links/include \
&& ln -sf /usr/lib64/openmpi/lib netcdf_links/lib \
&& export NETCDF=/wrf/netcdf_links \
&& export JASPERINC=/usr/include/jasper/ \
&& export JASPERLIB=/usr/lib64/
ENV LD_LIBRARY_PATH /usr/lib64/openmpi/lib
ENV PATH /usr/lib64/openmpi/bin:$PATH
#
#
RUN ssh-keygen -f /wrf/.ssh/id_rsa -t rsa -N '' \
&& chmod 600 /wrf/.ssh/config \
&& chmod 700 /wrf/.ssh \
&& cp /wrf/.ssh/id_rsa.pub /wrf/.ssh/authorized_keys
#
#
VOLUME /wrf
CMD ["/bin/tcsh"]
#