-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
177 lines (160 loc) · 4.48 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
FROM centos:7
MAINTAINER Jay Johnson <[email protected]>
RUN yum install -y \
python-pip \
python-devel \
wget \
python-setuptools
RUN wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm -d && \
yum localinstall mysql-community-release-el7-5.noarch.rpm -y && \
yum install mysql-community-server -y && \
rm mysql-community-release-el7-5.noarch.rpm && \
yum clean all
RUN yum install -y MySQL-python epel-release
RUN yum update -y && yum install -y \
autoconf \
binutils \
boost \
boost-devel \
build-essential \
bzip2 \
ca-certificates \
cron \
curl \
curl-devel \
emacs \
fonts-dejavu \
gcc \
gcc-c++ \
gfortran \
git \
hostname \
jed \
julia \
libaio \
libav-tools \
libmysqlclient-dev \
libnettle4 \
libsm6 \
libxml2-devel \
libxrender1 \
libxslt \
libxslt-devel \
locales \
logrotate \
llvm \
llvm-devel \
make \
mariadb-server \
mlocate \
net-tools \
pandoc \
pcre-devel \
perl \
perl-devel \
postgresql-devel \
procps \
pwgen \
python-dev \
python-devel \
python-pip \
python-setuptools \
redis \
rsyslog \
sqlite \
sqlite-devel \
sudo \
tar \
telnet \
texlive-fonts-extra \
texlive-fonts-recommended \
texlive-generic-recommended \
texlive-latex-base \
texlive-latex-extra \
tree \
unzip \
vim \
vim-enhanced \
wget \
which \
freetype \
freetype-devel \
libpng \
libpng-devel \
libpng-devel \
python-virtualenv \
mariadb-devel \
libattr-devel \
openssh \
openssh-client \
openssl-devel \
libpcap \
libpcap-devel \
tkinter \
&& yum clean all
RUN easy_install pip && \
/usr/bin/pip install --upgrade pip && \
/usr/bin/pip install --upgrade setuptools
# Environment Deployment Type
ENV ENV_DEPLOYMENT_TYPE DEV
ENV ENV_IN_DOCKER 1
ENV ENV_DEBUG_LOADING 0
ENV ENV_PROJ_DIR /opt/work
ENV ENV_DATA_DIR /opt/work/data
ENV ENV_DATA_SRC_DIR /opt/work/data/src
ENV ENV_DATA_DST_DIR /opt/work/data/dst
ENV ENV_SRC_DIR /opt/work/src
ENV ENV_THIRD_PARTY_DIR /opt/work/thirdparty
ENV ENV_CONFIGS_DIR /opt/work/configs
ENV ENV_CL_ENV_DIR /opt/work/env
# Allow running starters from outside the container
ENV ENV_BIN_DIR /opt/work/bins
ENV ENV_PRESTART_SCRIPT /opt/tools/pre-start.sh
ENV ENV_START_SCRIPT /opt/tools/start-services.sh
ENV ENV_POSTSTART_SCRIPT /opt/tools/post-start.sh
ENV ENV_CUSTOM_SCRIPT /opt/tools/custom-pre-start.sh
ENV ENV_DEFAULT_VENV /venv
ENV ENV_AWS_ACCESS_KEY NOT_A_REAL_KEY
ENV ENV_AWS_SECRET_KEY NOT_A_REAL_KEY
ENV ENV_SET_AS_PYTHONPATH /opt/work
ENV ENV_SSH_CREDS /opt/shared/.ssh
ENV ENV_GIT_CONFIG /opt/shared/.gitconfig
ENV ENV_AWS_CREDS /root/.aws/credentials
ENV ENV_AWS_PROFILE default
RUN mkdir -p -m 777 /opt \
&& mkdir -p -m 777 /opt/deps \
&& mkdir -p -m 777 /opt/work \
&& mkdir -p -m 777 /opt/work/bins \
&& mkdir -p -m 777 /opt/work/configs \
&& mkdir -p -m 777 /opt/work/data \
&& mkdir -p -m 777 /opt/work/data/dst \
&& mkdir -p -m 777 /opt/work/data/src \
&& mkdir -p -m 777 /opt/work/src \
&& mkdir -p -m 777 /opt/work/env \
&& mkdir -p -m 777 /opt/work/thirdparty \
&& mkdir -p -m 777 /opt/shared \
&& mkdir -p -m 777 /opt/tools \
&& touch /tmp/firsttimerunning
WORKDIR /opt/work
# Add the starters and installers:
ADD ./docker/ /opt/tools/
RUN chmod 777 /opt/tools/*.sh \
&& mv /opt/tools/python2 /opt/ \
&& chmod 777 /opt/python2
RUN pushd /opt/python2 && /opt/python2/install_confluent_platform.sh && popd
RUN virtualenv /venv && /opt/python2/install_pips.sh && /venv/bin/pip list
RUN /venv/bin/pip freeze > /opt/shared/python2-requirements.txt
# Add files to start default-locations
RUN cp /opt/tools/bashrc /root/.bashrc \
&& cp /opt/tools/vimrc /root/.vimrc \
&& cp /opt/tools/gitconfig /root/.gitconfig \
&& cp /opt/tools/pre-start.sh /usr/local/bin/ \
&& cp /opt/tools/start-container.sh /usr/local/bin/ \
&& cp /opt/tools/post-start.sh /usr/local/bin/ \
&& cp /opt/tools/custom-pre-start.sh /usr/local/bin/ \
&& cp /opt/tools/start-services.sh /usr/local/bin/ \
&& cp /opt/tools/start-container.sh /opt/start-container.sh \
&& cp /opt/start-container.sh /usr/local/bin/start-container.sh \
&& chmod 644 /root/.bashrc && chown root:root /root/.bashrc \
&& cat /opt/tools/inputrc >> /etc/inputrc
CMD [ "/opt/start-container.sh" ]