-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile.centos-7
122 lines (92 loc) · 5.1 KB
/
Dockerfile.centos-7
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
FROM centos:7
ARG TERM=linux
ARG SCIDB_NAME=scidb
ARG SCIDB_LOG_LEVEL=WARN
ENV SCIDB_VER=19.3 \
SCIDB_NAME=scidb
ENV SCIDB_INSTALL_PATH=/opt/scidb/$SCIDB_VER
ENV PATH=$PATH:$SCIDB_INSTALL_PATH/bin
ARG SCIDB_SCRIPT_URL="https://downloads.paradigm4.com/community/$SCIDB_VER/install-scidb-ce.sh"
## Prep for systemd 1/2
ENV container docker
RUN ( cd /lib/systemd/system/sysinit.target.wants/; \
for i in *; \
do [ $i = systemd-tmpfiles-setup.service ] || rm --force $i; \
done ); \
rm --force /etc/systemd/system/*.wants/*; \
rm --force /lib/systemd/system/anaconda.target.wants/*; \
rm --force /lib/systemd/system/basic.target.wants/*; \
rm --force /lib/systemd/system/local-fs.target.wants/*; \
rm --force /lib/systemd/system/multi-user.target.wants/*; \
rm --force /lib/systemd/system/sockets.target.wants/*initctl*; \
rm --force /lib/systemd/system/sockets.target.wants/*udev*
VOLUME [ "/sys/fs/cgroup" ]
## Install dependencies
RUN yum install --assumeyes \
patch \
wget \
which \
&& yum clean all
## Get SciDB install script
RUN wget --no-verbose --output-document /install-scidb-ce.sh "$SCIDB_SCRIPT_URL"
## Run SciDB install script
RUN yes \
| bash -x /install-scidb-ce.sh \
&& yum install --assumeyes \
scidb-$SCIDB_VER-dev \
&& yum clean all
# scidb-$SCIDB_VER-libboost-devel \
## Setup SSH
RUN echo 'StrictHostKeyChecking no' \
>> /etc/ssh/ssh_config \
&& ssh-keygen -f /root/.ssh/id_rsa -q -N "" \
&& cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
## Setup SciDB config file
COPY config.ini $SCIDB_INSTALL_PATH/etc/
## Setup PostgreSQL and SciDB
RUN echo "127.0.0.1:5432:$SCIDB_NAME:$SCIDB_NAME:` \
date +%s | sha256sum | base64 | head -c 32`" \
> /root/.pgpass \
&& chmod go-r /root/.pgpass \
&& chmod a+r $SCIDB_INSTALL_PATH/etc/config.ini \
&& ssh-keygen -A \
&& /usr/sbin/sshd \
&& sed --in-place \
s/\\.\\.\\.0/172.17.0.0/ \
/var/lib/pgsql/9.3/data/pg_hba.conf \
&& su --command=" \
/usr/pgsql-9.3/bin/pg_ctl start \
-D /var/lib/pgsql/9.3/data/ \
-s \
-w \
-t 300" \
postgres \
&& until su --command="/usr/pgsql-9.3/bin/pg_isready" postgres \
; do sleep 1 \
; done \
&& su --command=" \
$SCIDB_INSTALL_PATH/bin/scidbctl.py init-syscat $SCIDB_NAME \
--db-password ` \
cut --delimiter : --fields 5 /root/.pgpass`" \
postgres \
&& $SCIDB_INSTALL_PATH/bin/scidbctl.py init-cluster --force \
$SCIDB_NAME \
&& su --command=" \
/usr/pgsql-9.3/bin/pg_ctl stop \
-D /var/lib/pgsql/9.3/data/ \
-s \
-m fast" \
postgres \
&& sed --in-place \
s/log4j.rootLogger=INFO/log4j.rootLogger=$SCIDB_LOG_LEVEL/ \
$SCIDB_INSTALL_PATH/share/scidb/log4cxx.properties
## Setup container entrypoint
COPY docker-entrypoint-centos-7.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
## Port | App
## -----+-----
## 1239 | SciDB iquery
EXPOSE 1239
## Prep for systemd 2/2
RUN rm /lib/systemd/system/sysinit.target.wants/sys-fs-fuse-connections.mount; \
rm /etc/systemd/system/multi-user.target.wants/postfix.service