-
Notifications
You must be signed in to change notification settings - Fork 29
/
Dockerfile-ubuntu
60 lines (47 loc) · 1.83 KB
/
Dockerfile-ubuntu
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
ARG UBUNTU_VERSION=16.04
FROM ubuntu:${UBUNTU_VERSION}
ARG FPM_VERSION=1.11.0
ARG PYTHON_VERSION=3
ARG DOCKER_WORKDIR=/usr/share/pdagent
ARG SKIP_SYSTEMD=false
ENV PYTHON_VERSION ${PYTHON_VERSION}
ENV container docker
ENV DEBIAN_FRONTEND noninteractive
ENV DOCKER_WORKDIR ${DOCKER_WORKDIR}
# There is known issues with Docker + systemd
ENV SKIP_SYSTEMD ${SKIP_SYSTEMD}
RUN apt-get update -y -qq
RUN apt-get install -y -q apt-utils
RUN apt-get install -y -q build-essential
RUN apt-get install -y -q ca-certificates
RUN apt-get install -y -q python-software-properties
RUN apt-get install -y -q ruby2.3
RUN apt-get install -y -q ruby2.3-dev
RUN apt-get install -y -q software-properties-common
RUN apt-get install -y -q sudo
RUN apt-get install -y -q systemd
RUN apt-get install -y -q bsdmainutils
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN update-ca-certificates
# Lock dotenv version to prevent ruby 3.0 requirement
RUN gem install -q --no-ri --no-rdoc -v 2.8.1 dotenv
# Lock ffi version to prevent ruby 2.5 requirement
RUN gem install -q --no-ri --no-rdoc -v 1.15.5 ffi
RUN gem install -q --no-ri --no-rdoc -v ${FPM_VERSION} fpm
RUN apt-get install -y -q python${PYTHON_VERSION}
RUN cd /lib/systemd/system/sysinit.target.wants/ \
&& ls | grep -v systemd-tmpfiles-setup | xargs rm -f $1
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/basic.target.wants/* \
/lib/systemd/system/anaconda.target.wants/* \
/lib/systemd/system/plymouth* \
/lib/systemd/system/systemd-update-utmp*
VOLUME [ "/sys/fs/cgroup" ]
COPY . $DOCKER_WORKDIR
WORKDIR $DOCKER_WORKDIR
CMD ["/lib/systemd/systemd"]