-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.baseimage
102 lines (92 loc) · 2.79 KB
/
Dockerfile.baseimage
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
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND=noninteractive
# Disable documentation
RUN echo "# no documentation inside container\n\
path-exclude /usr/share/doc/*\n\
path-exclude /usr/share/man/*\n\
path-exclude /usr/share/info/*\n\
path-exclude /usr/share/lintian/*\n\
path-exclude /usr/share/locale/*\n\
path-exclude /usr/lib/systemd/*\n\
path-exclude /usr/lib/valgrind/*\n\
" > /etc/dpkg/dpkg.cfg.d/docker-no-documentation
RUN echo "# disable recommends and suggests\n\
APT::Install-Recommends \"0\";\n\
APT::Install-Suggests \"0\";\n\
" > /etc/apt/apt.conf.d/docker-no-suggests
RUN echo "# disable suggestions\n\
APT::Install-Recommends \"false\";\n\
APT::AutoRemove::RecommendsImportant \"false\";\n\
APT::AutoRemove::SuggestsImportant \"false\";\n\
" > /etc/apt/apt.conf.d/docker-autoremove-suggests
# Cleanup, upgrade and install apt-utils
RUN sed 's/archive.ubuntu.com/mirror.yandex.ru/' -i /etc/apt/sources.list && \
apt-get -qq remove --purge -y insserv && \
apt-get -qq dist-upgrade -y -o Dpkg::Options::="--force-confold" && \
apt-get -qq update && \
apt-get -qq install -y apt-utils
#
# nginx: ABF5BD827BD9BF62
# ansible: 93C4A3FD7BB9C367
#
RUN echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list && \
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" > etc/apt/sources.list.d/ansible.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABF5BD827BD9BF62 && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 && \
apt-get -qq update
# Install mandatory software
RUN apt-get -qq install -y \
apt-transport-https \
tzdata \
locales \
ca-certificates \
vim-tiny \
runit \
htop \
psmisc \
nginx \
bcron \
gettext-base \
msmtp \
ansible \
net-tools \
curl \
telnet \
make \
less \
dnsutils \
iproute
# Setup locale and update CA
RUN locale-gen en_US.UTF-8 ru_RU.UTF-8 && \
ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime && \
update-ca-certificates --fresh
# Cleanup
# + remove default configuration files for nginx, and cron.
RUN apt-get -qq clean && \
apt-get -qq autoremove --purge && \
rm -rf \
/etc/cron.* \
/etc/nginx/nginx.conf \
/etc/alternatives/*.gz \
/etc/dbus-1/* \
/etc/dhcp/dhclient-exit-hooks.d/* \
/etc/update-motd.d/* \
/etc/rc?.d/* \
/etc/init.d/* \
/var/lib/apt/lists/* \
/usr/share/doc/* \
/usr/share/man/* \
/usr/share/info/* \
/usr/share/lintian/* \
/usr/share/locale/* \
/usr/lib/systemd/* \
/usr/lib/valgrind/* \
/var/log/alternatives.log \
/var/log/bootstrap.log \
/var/log/dpkg.log \
/var/log/apt/* \
/tmp/*
# Perform configuration
COPY . /build/
RUN /build/system/configure.sh && \
rm -rf /build