-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile.centos-6
108 lines (82 loc) · 4.02 KB
/
Dockerfile.centos-6
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
FROM centos:6
ARG TERM=linux
ARG SCIDB_NAME=scidb
ARG SCIDB_LOG_LEVEL=WARN
ARG SCIDB_SCRIPT_URL="https://downloads.paradigm4.com/community/18.1/install-scidb-ce.sh"
ARG SHIM_SHA1=ceec9f5f92d869d052f2654aa113238b59e11a42
ENV SCIDB_VER=18.1 \
SCIDB_NAME=scidb
ENV SCIDB_INSTALL_PATH=/opt/scidb/$SCIDB_VER
ENV PATH=$PATH:$SCIDB_INSTALL_PATH/bin
## Install dependencies
RUN yum install --assumeyes \
https://downloads.paradigm4.com/devtoolset-3/centos/6/sclo/x86_64/rh/devtoolset-3/scidb-devtoolset-3.noarch.rpm \
&& yum install --assumeyes \
devtoolset-3-runtime \
devtoolset-3-toolchain \
openssl-devel \
wget \
zlib-devel \
&& yum clean all
## Get SciDB install script
RUN wget --no-verbose --output-document /install-scidb-ce.sh $SCIDB_SCRIPT_URL
RUN chmod +x /install-scidb-ce.sh
## Run SciDB install script
RUN yes \
| /install-scidb-ce.sh \
&& yum install --assumeyes \
log4cxx-devel \
protobuf-devel \
scidb-$SCIDB_VER-dev \
scidb-$SCIDB_VER-libboost-devel \
&& yum clean all
## 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 \
&& service sshd start \
&& service postgresql-9.3 start \
&& until /usr/pgsql-9.3/bin/pg_isready; do sleep 1; done \
&& su --command=" \
$SCIDB_INSTALL_PATH/bin/scidb.py init-syscat $SCIDB_NAME \
--db-password ` \
cut --delimiter : --fields 5 /root/.pgpass`" \
postgres \
&& $SCIDB_INSTALL_PATH/bin/scidb.py init-all --force $SCIDB_NAME \
&& service postgresql-9.3 stop \
&& sed --in-place \
s/log4j.rootLogger=INFO/log4j.rootLogger=$SCIDB_LOG_LEVEL/ \
$SCIDB_INSTALL_PATH/share/scidb/log4cxx.properties
RUN wget --no-verbose --output-document - \
https://github.com/Paradigm4/shim/archive/$SHIM_SHA1.tar.gz \
| tar --extract --gzip --directory=/usr/local/src \
&& cd /usr/local/src/shim-$SHIM_SHA1 \
&& make service \
&& openssl req \
-new \
-newkey rsa:4096 \
-days 3650 \
-nodes \
-x509 \
-subj "/C=US/ST=MA/L=Waltham/O=Paradigm4/CN=$(hostname)" \
-keyout /var/lib/shim/ssl_cert.pem \
2> /dev/null \
>> /var/lib/shim/ssl_cert.pem
## Setup container entrypoint
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
## Port | App
## -----+-----
## 1239 | SciDB iquery
## 8080 | SciDB Shim (HTTP)
## 8083 | SciDB Shim (HTTPS)
EXPOSE 1239 8080 8083