-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
192 lines (173 loc) · 5.06 KB
/
Dockerfile
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
FROM debian:buster
LABEL maintainer="Valentino Lauciani <[email protected]>"
ENV DEBIAN_FRONTEND=noninteractive
ENV INITRD No
ENV FAKE_CHROOT 1
ARG TARGETPLATFORM
# Print ARCHITECTURE variable
RUN echo "Detected architecture: $(uname -m)"
# install packages
RUN apt-get update \
&& apt-get install -y \
vim \
git \
telnet \
dnsutils \
wget \
curl \
default-jre \
apt-transport-https \
procps
RUN apt-get update \
&& apt-get install -y \
python3-dev \
python3-pycurl \
python3-simplejson \
libcurl4-gnutls-dev \
libssl-dev \
python3 \
python3-psutil \
python3-requests \
python3-jsonschema \
python3-setuptools \
python3-dev \
python3-pip \
build-essential \
libxml2-dev \
libxslt1-dev \
libz-dev
# Upgrade pip
RUN python3 -m pip install --upgrade pip
# Set .bashrc
RUN echo "" >> /root/.bashrc \
&& echo "##################################" >> /root/.bashrc \
&& echo "alias ll='ls -l --color'" >> /root/.bashrc \
&& echo "" >> /root/.bashrc \
&& echo "export LC_ALL=\"C\"" >> /root/.bashrc \
&& echo "" >> /root/.bashrc
# Set 'root' pwd
RUN echo root:toor | chpasswd
# Get and install rdseed
WORKDIR /opt
COPY soft/rdseedv5.3.1.tar.gz /opt/
RUN tar xvzf rdseedv5.3.1.tar.gz \
&& rm /opt/rdseedv5.3.1.tar.gz \
&& cd /usr/bin \
&& ln -s /opt/rdseedv5.3.1/rdseed.rh6.linux_64 rdseed
# Install qlib
WORKDIR /opt
COPY soft/qlib2.2019.365.tar.gz /opt/
RUN tar xvzf qlib2.2019.365.tar.gz \
&& rm qlib2.2019.365.tar.gz \
&& cd qlib2 \
&& cp Makefile Makefile.original \
&& sed -e 's|ROOTDIR\s=.*|ROOTDIR = /usr/local|' -e 's|LEAPSECONDS\s=.*|LEAPSECONDS = /usr/local/etc/leapseconds|' Makefile > Makefile.new \
&& mv Makefile.new Makefile \
&& ARCHITECTURE=$(uname -m) \
&& if [ "${ARCHITECTURE}" = "aarch64" ]; then \
sed -e 's|C64\s=.*|C64 = |' Makefile > Makefile.new \
&& mv Makefile.new Makefile ; \
fi \
&& mkdir /usr/local/share/man/man3/ \
&& mkdir /usr/local/lib64 \
&& make clean \
&& make all64 \
&& make install64 \
&& rm -fr /opt/qlib2
# Install qmerge
WORKDIR /opt
COPY soft/qmerge.2014.329.tar.gz /opt/
RUN tar xvzf qmerge.2014.329.tar.gz \
&& rm qmerge.2014.329.tar.gz \
&& cd qmerge \
&& cp Makefile Makefile.original \
&& sed -e 's|^QLIB2.*|QLIB2 = /usr/local/lib64/libqlib2.a|' Makefile > Makefile.new \
&& mv Makefile.new Makefile \
&& ARCHITECTURE=$(uname -m) \
&& if [ "${ARCHITECTURE}" = "aarch64" ]; then \
sed -e 's|^CC.*|CC = cc -Wall|' Makefile > Makefile.new \
&& mv Makefile.new Makefile ; \
fi \
&& make clean \
&& make install \
&& rm -fr /opt/qmerge
# Install ObsPy
RUN pip3 install obspy
# Get and install PyRocko - https://pyrocko.org/docs/current/install/system/deb.html
WORKDIR /opt
RUN apt-get update \
&& apt-get install -y \
make \
git \
python3-dev \
python3-setuptools
RUN apt-get update \
&& apt-get install -y \
python3-numpy \
python3-numpy-dev \
python3-scipy \
python3-matplotlib
RUN apt-get update \
&& apt-get install -y \
python3-pyqt4 \
python3-pyqt4.qtopengl
RUN apt-get update \
&& apt-get install -y \
python3-pyqt5 \
python3-pyqt5.qtopengl \
python3-pyqt5.qtsvg
RUN apt-get update \
&& apt-get install -y \
python3-pyqt5.qtwebengine || apt-get install -y python3-pyqt5.qtwebkit
RUN apt-get update \
&& apt-get install -y \
python3-yaml \
python3-progressbar \
python3-jinja2
RUN apt-get update \
&& apt-get install -y \
python3-requests
COPY soft/pyrocko_v2024.01.10.tar.gz /opt/
RUN tar xvzf pyrocko_v2024.01.10.tar.gz \
&& rm pyrocko_v2024.01.10.tar.gz \
&& cd pyrocko* \
&& python3 setup.py install
WORKDIR /
RUN mkdir /.pyrocko/ \
&& chmod 777 /.pyrocko/
# Get last leapseconds
WORKDIR /usr/local/etc
RUN wget -O leapseconds http://www.ncedc.org/ftp/pub/programs/leapseconds
# Install Xml2Resp and scripts
WORKDIR /opt
COPY soft/stationxml-converter-1.0.10.jar /opt/
COPY soft/stationxml-seed-converter-2.1.0.jar /opt/
COPY 01_find_stations.sh /opt/
COPY 02_get_dless-resp-paz.sh /opt/
COPY 021_get_dless-resp-paz_parallel.sh /opt/
COPY 03_get_dataselect_list-mseed-sac.sh /opt/
COPY 031_get_mseed-sac_parallel.sh /opt/
COPY entrypoint.sh /opt/
COPY config.sh /opt/
COPY seed_handler.py /opt/
COPY publiccode.yml /opt/
RUN chmod 755 /opt/01_find_stations.sh
RUN chmod 755 /opt/02_get_dless-resp-paz.sh
RUN chmod 755 /opt/021_get_dless-resp-paz_parallel.sh
RUN chmod 755 /opt/03_get_dataselect_list-mseed-sac.sh
RUN chmod 755 /opt/031_get_mseed-sac_parallel.sh
RUN chmod 755 /opt/seed_handler.py
RUN chmod 755 /opt/publiccode.yml
RUN chmod 777 /opt
# Create OUTPUT dir
WORKDIR /opt
RUN mkdir /opt/OUTPUT
RUN chmod -R 777 /opt/OUTPUT
#
RUN echo "BUILDPLATFORM=${BUILDPLATFORM}" > /tmp/arc
RUN echo "TARGETPLATFORM=${TARGETPLATFORM}" >> /tmp/arc
RUN echo "TARGETOS=${TARGETOS}" >> /tmp/arc
RUN echo "TARGETARCH=${TARGETARCH}" >> /tmp/arc
RUN uname -m >> /tmp/arc
# Set entrypoint
ENTRYPOINT ["./entrypoint.sh"]