-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
113 lines (99 loc) · 4.7 KB
/
Dockerfile
File metadata and controls
113 lines (99 loc) · 4.7 KB
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
FROM zeroc0d3lab/centos-base-workspace-lite:latest
MAINTAINER ZeroC0D3 Team <zeroc0d3.team@gmail.com>
#-----------------------------------------------------------------------------
# Set Environment
#-----------------------------------------------------------------------------
ENV PATH_HOME=/home/docker \
PATH_WORKSPACE=/home/docker/workspace
#-----------------------------------------------------------------------------
# Install Python Dependency
#-----------------------------------------------------------------------------
RUN yum -y install \
--setopt=tsflags=nodocs \
--disableplugin=fastestmirror \
gcc \
gcc-c++ \
kernel-devel \
readline-dev \
ncurses \
ncurse-devel \
lua-devel \
lzo-devel \
vim*
#-----------------------------------------------------------------------------
# Install Python 3.5
#-----------------------------------------------------------------------------
RUN yum -y install https://centos7.iuscommunity.org/ius-release.rpm \
&& yum -y update \
&& yum -y install python35u python35u-libs python35u-devel python35u-pip
#-----------------------------------------------------------------------------
# Install Python 2.7
#-----------------------------------------------------------------------------
# RUN yum -y rpm-build \
# redhat-rpm-config \
# yum-utils \
# && yum -y groupinstall "Development Tools" \
# && sudo yum-builddep -y python-2.7.11-4.fc24.src.rpm \
# && mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} \
# && cd ~/rpmbuild/SRPMS \
# && curl -O https://kojipkgs.fedoraproject.org//packages/python/2.7.11/4.fc24/src/python-2.7.11-4.fc24.src.rpm \
# && cd ~/rpmbuild/SRPMS \
# && rpmbuild --rebuild python-2.7.11-4.fc24.src.rpm \
# && cd ~/rpmbuild/SPECS/ \
# && sed -i -e "s/^%global run_selftest_suite 1/%global run_selftest_suite 0/g" python.spec # OPTIONAL \
# && rpmbuild -ba python.spec \
# && cd ~/rpmbuild/SRPMS/ \
# && rpmbuild --rebuild python2711-2.7.11-4.el7.centos.src.rpm \
# && cd ~/rpmbuild/RPMS/ \
# && sudo yum localinstall --nogpgcheck python-libs-2.7.11-4.el7.centos.x86_64.rpm python-2.7.11-4.el7.centos.x86_64.rpm
#-----------------------------------------------------------------------------
# Clean Up All Cache
#-----------------------------------------------------------------------------
RUN yum clean all
# -----------------------------------------------------------------------------
# UTC Timezone & Networking
# -----------------------------------------------------------------------------
RUN ln -sf \
/usr/share/zoneinfo/UTC \
/etc/localtime \
&& echo "NETWORKING=yes" > /etc/sysconfig/network
#-----------------------------------------------------------------------------
# Set Configuration
#-----------------------------------------------------------------------------
COPY rootfs/ /
#-----------------------------------------------------------------------------
# Cleanup 'root', 'opt' & 'tmp' folder
#-----------------------------------------------------------------------------
RUN rm -f /root/*.tar.gz \
&& rm -f /root/*.zip \
&& rm -f /opt/*.tar.gz \
&& rm -f /opt/*.zip \
&& rm -f /tmp/*.tar.gz \
&& rm -f /tmp/*.zip
#-----------------------------------------------------------------------------
# Create Workspace Application Folder
#-----------------------------------------------------------------------------
RUN mkdir -p ${PATH_WORKSPACE} \
mkdir -p /var/run/s6
#-----------------------------------------------------------------------------
# Fixing ownership for 'docker' user
#-----------------------------------------------------------------------------
RUN chown -R docker:docker ${PATH_HOME}
#-----------------------------------------------------------------------------
# Set PORT Docker Container
#-----------------------------------------------------------------------------
EXPOSE 22
#-----------------------------------------------------------------------------
# Set Volume Application
#-----------------------------------------------------------------------------
VOLUME [${PATH_WORKSPACE}]
#-----------------------------------------------------------------------------
# Run Init Docker Container
#-----------------------------------------------------------------------------
ENTRYPOINT ["/init"]
CMD []
#-----------------------------------------------------------------------------
# Check Docker Container
#-----------------------------------------------------------------------------
# HEALTHCHECK CMD [ $(curl -sI -w '%{http_code}' --out /dev/null http://localhost:8500/v1/agent/self) == "200" ] || exit 1
HEALTHCHECK CMD --interval=5m --timeout=3s /etc/cont-consul/check || exit 1