-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (45 loc) · 1.73 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
FROM ubuntu:16.04
LABEL maintainer="Michael Buluma"
ENV pip_packages "ansible pyopenssl"
# Fix 'ordinal not in range' error.
ENV LC_CTYPE en_US.UTF-8
ENV LANG en_US.UTF-8
# Install dependencies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
python-software-properties \
software-properties-common \
python-setuptools \
wget rsyslog systemd systemd-cron sudo iproute2 \
&& rm -Rf /var/lib/apt/lists/* \
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man \
&& apt-get clean \
&& wget https://bootstrap.pypa.io/pip/2.7/get-pip.py \
&& python get-pip.py
RUN sed -i 's/^\($ModLoad imklog\)/#\1/' /etc/rsyslog.conf
# Fix potential UTF-8 errors with ansible-test.
RUN locale-gen en_US.UTF-8
# Install Ansible via Pip.
# RUN pip install $pip_packages
COPY initctl_faker .
RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl
# Install Ansible inventory file.
# RUN mkdir -p /etc/ansible
# RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
# Disable getty services, which otherwise will consume 100% CPU
# There are two simple solutions to this:
#
# RUN cp /bin/true /sbin/agetty
#
# or:
RUN ln -s /dev/null /etc/systemd/system/[email protected] \
&& ln -s /dev/null /etc/systemd/system/[email protected] \
&& ln -s /dev/null /etc/systemd/system/[email protected] \
&& ln -s /dev/null /etc/systemd/system/[email protected] \
&& ln -s /dev/null /etc/systemd/system/[email protected] \
&& ln -s /dev/null /etc/systemd/system/[email protected]
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
CMD ["/lib/systemd/systemd"]
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/ || exit 1