-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
83 lines (63 loc) · 2.75 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
FROM fredmassin/self-compiling_seiscomp_vanilla
MAINTAINER Fred Massin <[email protected]>
ENV REPO_PATH https://github.com/SeisComP
ENV WORK_DIR /usr/local/src
ENV INSTALL_DIR /opt/seiscomp
# Fix Debian env
ENV DEBIAN_FRONTEND noninteractive
ENV INITRD No
ENV FAKE_CHROOT 1
# Setup sysop's user and group id
ENV USER_ID 1000
ENV GROUP_ID 1000
WORKDIR $WORK_DIR
WORKDIR /home/sysop
RUN apt-get update && \
apt-get install -y \
xfce4 \
xfce4-goodies \
tightvncserver
COPY etc/*.cfg $INSTALL_DIR/etc/
RUN cd $INSTALL_DIR/../ && \
wget "https://www.seiscomp.de/downloader/seiscomp-maps.tar.gz" && \
tar xzf seiscomp-maps.tar.gz && \
rm seiscomp-maps.tar.gz
#RUN wget "https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?starttime="$(date -u +'%Y-%m-%dT%H:%M:%S')"&format=sc3ml&level=response" -O $INSTALL_DIR/etc/inventory/shakenet.xml
RUN wget "https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?format=sc3ml&level=response" -O $INSTALL_DIR/etc/inventory/shakenet.xml
RUN chown -R sysop:sysop $INSTALL_DIR/
ADD seiscomp.cnf /etc/mysql/conf.d/
RUN /etc/init.d/mysql start && \
sleep 5 && \
mysql -u root -e "CREATE DATABASE seiscomp" && \
mysql -u root -e "CREATE USER 'sysop'@'localhost' IDENTIFIED BY 'sysop'" && \
mysql -u root -e "GRANT ALL PRIVILEGES ON * . * TO 'sysop'@'localhost'" && \
mysql -u root -e "FLUSH PRIVILEGES" && \
mysql -u root seiscomp < $INSTALL_DIR/share/db/mysql.sql && \
su sysop -s /bin/bash -c "source /home/sysop/.profile ; seiscomp start ; seiscomp update-config"
USER sysop
ADD scrc /home/sysop/
RUN echo "source /home/sysop/scrc" >> /home/sysop/.bashrc
RUN cd /home/sysop && \
wget "https://github.com/FMassin/SeisComP-World-Shaded-Imagery-and-Geology/archive/refs/tags/v0.2.tar.gz" -O SCPWSIG.tar.gz && \
tar xzf SCPWSIG.tar.gz && \
rm SCPWSIG.tar.gz && \
ln -s /home/sysop/SeisComP-World-Shaded-Imagery-and-Geology*/bna .seiscomp/bna
## Start vncserverd
RUN mkdir /home/sysop/.vnc/
ADD xstartup /home/sysop/.vnc/
RUN touch /home/sysop/.Xauthority
RUN echo "sysop" | vncpasswd -f >> /home/sysop/.vnc/passwd
USER root
RUN chmod 600 /home/sysop/.vnc/passwd
RUN chmod +x /home/sysop/.vnc/xstartup
ADD vncserver /etc/init.d/
RUN chmod +x /etc/init.d/vncserver
## Start sshd
RUN passwd -d sysop
RUN sed -i'' -e's/^#PermitRootLogin prohibit-password$/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i'' -e's/^#PasswordAuthentication yes$/PasswordAuthentication yes/' /etc/ssh/sshd_config \
&& sed -i'' -e's/^#PermitEmptyPasswords no$/PermitEmptyPasswords yes/' /etc/ssh/sshd_config \
&& sed -i'' -e's/^UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
EXPOSE 22
CMD ["sh", "-c", "/usr/sbin/sshd -D & mysqld "]
#CMD bash service vncserver start