Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
157 lines (132 loc) · 4.34 KB
/
Copy pathDockerfile
File metadata and controls
157 lines (132 loc) · 4.34 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
FROM ubuntu:16.04
MAINTAINER Hasitha Dhananjaya <hasitha.10@cse.mrt.ac.lk>
ENV WRF_VERSION 4.0
ENV WPS_VERSION 4.0
ENV WRF_CONFIGURE_OPTION 34
ENV WPS_CONFIGURE_OPTION 1
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:ubuntugis/ppa \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y --allow-unauthenticated \
wget \
gcc \
csh \
gfortran \
gfortran-5-multilib \
libpng-dev \
build-essential \
apt-utils \
file \
m4 \
nco \
python3.6 \
python3-pip
RUN mkdir Build_WRF
WORKDIR Build_WRF
RUN mkdir LIBRARIES \
&& mkdir -p /home/Build_WRF/code \
&& mkdir -p /home/Build_WRF/logs \
&& mkdir -p /home/Build_WRF/gfs \
&& mkdir -p /home/Build_WRF/nfs \
&& mkdir -p /home/Build_WRF/geog \
&& mkdir -p /home/Build_WRF/archive
WORKDIR /home/Build_WRF/LIBRARIES
RUN wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/netcdf-4.1.3.tar.gz \
&& wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/mpich-3.0.4.tar.gz \
&& wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/zlib-1.2.7.tar.gz \
&& wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/libpng-1.2.50.tar.gz \
&& wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/jasper-1.900.1.tar.gz
ENV DIR /home/Build_WRF/LIBRARIES
ENV CC gcc
ENV CPP /lib/cpp -P
ENV CXX g++
ENV FC gfortran
ENV FCFLAGS -m64
ENV F77 gfortran
ENV FFLAGS -m64
# Installing NetCDF
RUN tar xzvf netcdf-4.1.3.tar.gz \
&& cd netcdf-4.1.3 \
&& ./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared \
&& make \
&& make install \
&& export PATH=$DIR/netcdf/bin:$PATH \
&& export NETCDF=$DIR/netcdf \
&& cd ..
# Installing MPICH
RUN tar xzvf mpich-3.0.4.tar.gz \
&& cd mpich-3.0.4 \
&& ./configure --prefix=$DIR/mpich \
&& make \
&& make install \
&& export PATH=$DIR/mpich/bin:$PATH \
&& cd ..
# Installing zlib
RUN export LDFLAGS=-L$DIR/grib2/lib \
&& export CPPFLAGS=-I$DIR/grib2/include \
&& tar xzvf zlib-1.2.7.tar.gz \
&& cd zlib-1.2.7 \
&& ./configure --prefix=$DIR/grib2 \
&& make \
&& make install \
&& cd ..
# Installing libpng
RUN export LDFLAGS=-L$DIR/grib2/lib \
&& export CPPFLAGS=-I$DIR/grib2/include \
&& tar xzvf libpng-1.2.50.tar.gz \
&& cd libpng-1.2.50 \
&& ./configure --prefix=$DIR/grib2 \
&& make \
&& make install \
&& cd ..
# Installing JasPer
RUN tar xzvf jasper-1.900.1.tar.gz \
&& cd jasper-1.900.1 \
&& ./configure --prefix=$DIR/grib2 \
&& make \
&& make install \
&& cd ..
# Permanent Export
ENV PATH "$DIR/netcdf/bin:$PATH"
ENV NETCDF "$DIR/netcdf"
ENV PATH "$DIR/mpich/bin:$PATH"
ENV LDFLAGS "-L$DIR/grib2/lib"
ENV CPPFLAGS "-I$DIR/grib2/include"
ENV JASPERLIB "$DIR/grib2/lib"
ENV JASPERINC "$DIR/grib2/include"
WORKDIR /home/Build_WRF
RUN wget http://www2.mmm.ucar.edu/wrf/src/WRFV$WRF_VERSION.TAR.gz \
&& wget http://www2.mmm.ucar.edu/wrf/src/WPSV$WPS_VERSION.TAR.gz
# Installing & building WRF
RUN tar -xvzf WRFV$WRF_VERSION.TAR.gz \
&& cd ./WRF \
&& echo $WRF_CONFIGURE_OPTION | ./configure \
&& ./compile em_real >> log.compile 2>&1 \
&& cd ..
# Installing & building WPS
RUN tar -xvzf WPSV$WPS_VERSION.TAR.gz \
&& cd ./WPS \
&& export JASPERLIB=$DIR/grib2/lib \
&& export JASPERINC=$DIR/grib2/include \
&& echo $WPS_CONFIGURE_OPTION | ./configure \
&& ./compile >> log.compile 2>&1 \
&& cd ..
# install gcsfuse
RUN apt-get install -y curl \
&& export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s` \
&& echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | tee /etc/apt/sources.list.d/gcsfuse.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& apt-get update \
&& apt-get install -y gcsfuse
WORKDIR /home/Build_WRF/code
COPY code /home/Build_WRF/code
COPY code/namelist.wps /home/Build_WRF
COPY code/namelist.input /home/Build_WRF
#install required libs for python script
RUN pip3 install -r requirements.yml
COPY uwcc-admin.json /home/Build_WRF/code/gcs.json
RUN chmod +x wrfv4_run.sh
CMD ["wrfv4_run.sh"]
VOLUME /home/Build_WRF