-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
159 lines (146 loc) · 5.54 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
FROM datt/datt-ubuntu:latest
MAINTAINER John Albietz <[email protected]>
RUN \
`# Dev Packages (very large. keep at top.)`; \
apt-get update; \
apt-get -y install \
python-software-properties \
build-essential \
make \
automake \
uuid-dev \
libtool \
python-pip; \
\
`# remove cached packages`; \
apt-get clean;
RUN \
`# install base utils`; \
apt-get update; \
apt-get -y install \
apt-utils \
pkg-config \
vim \
psmisc \
less \
curl \
wget \
rsync \
unzip \
sudo \
`# git from ppa.`; \
add-apt-repository -y ppa:git-core/ppa; \
apt-get update; \
apt-get -y install git; \
\
`# useful system tools (iputils* has ping & common tools)`; \
apt-get -y install \
iotop \
pv \
htop \
hdparm \
sysstat \
ethtool \
bwm-ng \
net-tools \
iputils*; \
\
`# install base services`; \
\
`# ssh w/docker fix`; \
apt-get -y install \
openssh-server \
ssh; \
mkdir -v /var/run/sshd; \
\
`# process supervisors`; \
apt-get -y install \
supervisor \
runit \
inotify-tools; \
pip install --upgrade circus circus-web; \
\
`# terminal multiplexers`; \
apt-get -y install \
screen \
byobu \
tmux; \
\
`# cron w/o checks for lost+found and scans for mtab`; \
apt-get -y install cron; \
rm -f /etc/cron.daily/standard; \
\
`# remove cached packages`; \
apt-get clean;
RUN \
`# logging`; \
\
`# heka 0.5.1 install`; \
DL_LOCATION="https://github.com/mozilla-services/heka/releases/download/v0.5.1/"; \
DL_FILE="heka_0.5.1_amd64.deb"; \
wget -c --no-check-certificate $DL_LOCATION$DL_FILE; \
dpkg -i ./$DL_FILE; \
rm -vf ./$DL_FILE; \
\
`# syslog-ng`; \
apt-get -y install syslog-ng-core; \
mkdir -p /var/lib/syslog-ng; \
\
`# logrotate`; \
apt-get -y install logrotate; \
\
`# remove cached packages`; \
apt-get clean;
ADD files/ /files/
RUN \
`# setup directories in /etc`; \
for p in hekad supervisor; do \
[ -h /etc/$p ] && echo "removing existing symlink $p" && unlink /etc/$p/; \
[ -d /etc/$p ] && echo "removing existing directory $p" && rm -rfv /etc/$p/; \
ln -vs /files/$p/ /etc/; \
done; \
\
`# setup directories in /var/log`; \
for p in test_server hekad crond sshd syslog-ng; do \
mkdir -v /var/log/supervisor/$p; \
done;
RUN \
`# Install serf client 0.5.0` ; \
mkdir -vp /opt/serf/; cd /opt/serf/ ; \
DL_LOCATION="https://dl.bintray.com/mitchellh/serf/" ; \
DL_FILE="0.5.0_linux_amd64.zip" ; \
wget --continue --no-check-certificate $DL_LOCATION$DL_FILE ; \
unzip $DL_FILE ; \
rm -v *.zip ; \
\
`# Install symlinks so they are in the path` ; \
ln -vs /opt/serf/serf /usr/sbin/serf ; \
\
`# Add app to supervisor` ; \
for i in serf-agent; do \
mkdir -v /var/log/supervisor/$i ; \
done;
# To run in DEBUG mode, run the docker container with RUN_DEBUG=1 set in the environment.
# Can set by running container with flag: `--env RUN_DEBUG=1`.
# modification to /etc/environment based on: https://github.com/dotcloud/docker/issues/2569
ENV RUN_DEBUG 0
# for /files/test_server.js
RUN \
apt-get update; \
apt-get install -y nodejs; \
mkdir -p /files/tests; \
apt-get clean
# Expose port for test_server.js
EXPOSE 13337
# Expose ports for serf-agent
EXPOSE 7373
EXPOSE 7946
CMD \
env | grep "._" >> /etc/environment ; \
if [ $RUN_DEBUG -ne 0 ] ; \
then \
echo [DEBUG] ; \
/usr/bin/supervisord && /bin/bash ; \
else \
/usr/bin/supervisord --nodaemon ; \
fi ;