-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
130 lines (116 loc) · 4.76 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
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM centos:7
LABEL maintainer="m9rco <[email protected]>"
ADD rootfs /
WORKDIR /root
# Create a metron user
RUN adduser metron; \
echo metron | passwd metron --stdin; \
usermod -aG wheel metron;
# Update 163 Images
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup \
&& curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo \
&& yum clean all \
&& yum makecache
# base development tools required \
RUN yum install -y \
tar \
initscripts \
sudo \
which \
centos-release-scl \
gcc \
devtoolset-4-gcc-c++ \
devtoolset-4-gcc \
zlib \
zlib-dev \
git \
readline-devel \
openssl-devel \
sqlite-devel \
bzip2-devel \
libffi-devel \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
nss \
asciidoc \
rpm-build \
rpm2cpio \
tar \
xmlto \
rpmlint \
make
RUN yum groupinstall -y "Development tools"
RUN curl -o /root/metron-0.7.1.tgr.gz https://m9rco-bjhb2-storage.oss-cn-beijing.aliyuncs.com/apache-metron_0.7.1-release.tar.gz \
&& tar xvf /root/metron-0.7.1.tgr.gz \
&& rm -f /root/metron-0.7.1.tgr.gz \
&& mv /root/metron-apache-metron_0.7.1-release /root/metron
# install python 2.7.11 but do not make it the default \
RUN curl -o /usr/src/Python-2.7.11.tgz https://m9rco-bjhb2-storage.oss-cn-beijing.aliyuncs.com/Python-2.7.11.tgz \
&& cd /usr/src \
&& tar xvf Python-2.7.11.tgz \
&& rm -rf Python-2.7.11.tgz \
&& cd /usr/src/Python-2.7.11 \
&& echo "hello marco" \
&& pwd \
&& ls -l \
&& ./configure \
&& make altinstall
# install pip
RUN cd /usr/src \
&& curl -o /usr/src/setuptools-11.3.tar.gz https://m9rco-bjhb2-storage.oss-cn-beijing.aliyuncs.com/setuptools-11.3.tar.gz \
&& tar xvf setuptools-11.3.tar.gz \
&& rm setuptools-11.3.tar.gz \
&& cd /usr/src/setuptools-11.3 \
&& mkdir /root/.pip \
&& echo "[global]" > /root/.pip/pip.conf \
&& echo "trusted-host=pypi.tuna.tsinghua.edu.cn" >> /root/.pip/pip.conf \
&& echo "index-url=https://pypi.tuna.tsinghua.edu.cn/simple/" >> /root/.pip/pip.conf \
&& python2.7 setup.py install \
&& easy_install-2.7 pip \
# install ansible and set the configuration var \
&& pip2.7 install cryptography==2.5 ansible==2.0.0.2 boto
# Install java \
RUN cd /usr/src \
# setup maven \
&& curl -o apache-maven-3.3.9-bin.tar.gz https://m9rco-bjhb2-storage.oss-cn-beijing.aliyuncs.com/apache-maven-3.3.9-bin.tar.gz \
&& tar xvf apache-maven-3.3.9-bin.tar.gz \
&& rm apache-maven-3.3.9-bin.tar.gz \
&& rm -rf /opt/maven/ \
&& mv apache-maven-3.3.9 /opt/maven \
&& ln -fs /opt/maven/bin/mvn /usr/bin/mvn \
# install rpm tools required to build rpms \
# create a .bashrc for root, enabling the cpp 11 toolset \
&& touch /root/.bashrc \
&& echo '/opt/rh/devtoolset-4/enable' >> /root/.bashrc \
# install node so that the node dependencies can be packaged into the RPMs \
&& curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - \
# Remove packages just needed for builds \
# Clean up yum caches \
&& yum clean all
# Enable systemd usage
# RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
# rm -f /lib/systemd/system/multi-user.target.wants/; \
# rm -f /etc/systemd/system/.wants/; \
# rm -f /lib/systemd/system/local-fs.target.wants/; \
# rm -f /lib/systemd/system/sockets.target.wants/udev; \
# rm -f /lib/systemd/system/sockets.target.wants/initctl; \
# rm -f /lib/systemd/system/basic.target.wants/; \
# rm -f /lib/systemd/system/anaconda.target.wants/*;
# VOLUME ["/sys/fs/cgroup"]
CMD ["/usr/sbin/init"]