-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
104 lines (92 loc) · 2.7 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
FROM ubuntu:focal-20210713 as python-build
# environment variables
ENV \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8 \
DEBIAN_FRONTEND=noninteractive
# install packages
RUN \
echo "deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse" >/etc/apt/sources.list && \
echo "deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse" >>/etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse" >>/etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libvirt-dev \
pkg-config \
python3 \
python3-dev \
python3-venv \
python3-wheel \
twine \
virtualenv \
wget \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists
# install pip
RUN \
cd /tmp && \
wget http://bootstrap.pypa.io/get-pip.py && \
python3 ./get-pip.py && \
rm -rfv *
# install dependencies
COPY requirements.txt /tmp/requirements.txt
RUN \
pip3 install \
--requirement /tmp/requirements.txt \
--ignore-installed \
--target /tmp/packages
FROM ubuntu:focal-20210713 as base
# environment variables
ENV \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8 \
DEBIAN_FRONTEND=noninteractive
# install packages
RUN \
echo "deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse" >/etc/apt/sources.list && \
echo "deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse" >>/etc/apt/sources.list && \
echo "deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse" >>/etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
bind9-host \
ca-certificates \
dirmngr \
dnsmasq \
dnsutils \
ed \
gpg \
gpg-agent \
haproxy \
inotify-tools \
iproute2 \
libvirt0 \
net-tools \
python3 \
python3-distutils \
runit \
wget \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
rm -vf /etc/ssh/ssh_host_*
# install tini
RUN \
TINI_VERSION=v0.19.0 && \
http_proxy='' gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0527A9B7 && \
wget -O/usr/bin/tini "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" && \
wget -O/usr/bin/tini.asc "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc" && \
gpg --verify /usr/bin/tini.asc && \
rm -f /usr/bin/tini.asc && \
chmod a+x /usr/bin/tini
# add python packages
COPY --from=python-build /tmp/packages /usr/lib/python3/dist-packages
# add scripts
ADD entrypoint dalidock haproxy-start /usr/sbin/
# add configuration scripts
ADD etc /etc/
# set entrypoint
ENTRYPOINT ["/usr/sbin/entrypoint"]