2019-06-22 13:26:23 -05:00
|
|
|
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
2019-07-26 00:06:41 -05:00
|
|
|
{% if CONFIGURED_ARCH == "armhf" %}
|
|
|
|
FROM multiarch/debian-debootstrap:armhf-stretch
|
|
|
|
{% elif CONFIGURED_ARCH == "arm64" %}
|
|
|
|
FROM multiarch/debian-debootstrap:arm64-stretch
|
|
|
|
{% else %}
|
2019-01-31 01:05:52 -06:00
|
|
|
FROM debian:stretch
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
2019-01-31 01:05:52 -06:00
|
|
|
|
|
|
|
# Clean documentation in FROM image
|
|
|
|
RUN find /usr/share/doc -depth \( -type f -o -type l \) ! -name copyright | xargs rm || true
|
|
|
|
|
|
|
|
# Clean doc directories that are empty or only contain empty directories
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN while [ -n "$(find /usr/share/doc -depth -type d -empty -print -exec rmdir {} +)" ]; do :; done && \
|
|
|
|
rm -rf \
|
2019-01-31 01:05:52 -06:00
|
|
|
/usr/share/man/* \
|
|
|
|
/usr/share/groff/* \
|
|
|
|
/usr/share/info/* \
|
|
|
|
/usr/share/lintian/* \
|
|
|
|
/usr/share/linda/* \
|
|
|
|
/var/cache/man/* \
|
|
|
|
/usr/share/locale/*
|
|
|
|
|
|
|
|
# Make apt-get non-interactive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
# Configure data sources for apt/dpkg
|
|
|
|
COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"]
|
2019-07-26 00:06:41 -05:00
|
|
|
{% if CONFIGURED_ARCH == "armhf" %}
|
|
|
|
COPY ["sources.list.armhf", "/etc/apt/sources.list"]
|
|
|
|
{% elif CONFIGURED_ARCH == "arm64" %}
|
|
|
|
COPY ["sources.list.arm64", "/etc/apt/sources.list"]
|
|
|
|
{% else %}
|
2019-01-31 01:05:52 -06:00
|
|
|
COPY ["sources.list", "/etc/apt/sources.list"]
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
2019-01-31 01:05:52 -06:00
|
|
|
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
|
2020-01-07 17:52:49 -06:00
|
|
|
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"]
|
2019-01-31 01:05:52 -06:00
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
# Update apt cache and
|
|
|
|
# pre-install fundamental packages
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get -y install \
|
|
|
|
less \
|
|
|
|
perl \
|
|
|
|
procps \
|
|
|
|
python \
|
|
|
|
rsyslog \
|
|
|
|
vim-tiny \
|
2019-01-31 01:05:52 -06:00
|
|
|
# Install dependencies of supervisor
|
2019-06-22 13:26:23 -05:00
|
|
|
python-pkg-resources \
|
2019-12-04 16:10:19 -06:00
|
|
|
python-meld3 \
|
|
|
|
# dependencies of redis-tools
|
|
|
|
libatomic1 \
|
|
|
|
libjemalloc1 \
|
|
|
|
liblua5.1-0 \
|
|
|
|
lua-bitop \
|
|
|
|
lua-cjson
|
2019-01-31 01:05:52 -06:00
|
|
|
|
2019-07-26 00:06:41 -05:00
|
|
|
{% if CONFIGURED_ARCH == "armhf" %}
|
|
|
|
# ip and ifconfig utility missing in docker for armhf
|
|
|
|
RUN apt-get -y install \
|
|
|
|
iproute2 \
|
|
|
|
net-tools
|
|
|
|
{% endif %}
|
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN mkdir -p /etc/supervisor /var/log/supervisor
|
2019-01-31 01:05:52 -06:00
|
|
|
|
|
|
|
RUN apt-get -y purge \
|
|
|
|
exim4 \
|
|
|
|
exim4-base \
|
|
|
|
exim4-config \
|
|
|
|
exim4-daemon-light
|
|
|
|
|
|
|
|
{% if docker_base_stretch_debs.strip() -%}
|
2019-06-22 13:26:23 -05:00
|
|
|
# Copy locally-built Debian package dependencies
|
|
|
|
{{ copy_files("debs/", docker_base_stretch_debs.split(' '), "/debs/") }}
|
2019-01-31 01:05:52 -06:00
|
|
|
|
|
|
|
# Install built Debian packages and implicitly install their dependencies
|
2019-06-22 13:26:23 -05:00
|
|
|
{{ install_debian_packages(docker_base_stretch_debs.split(' ')) }}
|
2019-01-31 01:05:52 -06:00
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
# Clean up apt
|
|
|
|
# Remove /var/lib/apt/lists/*, could be obsoleted for derived images
|
2019-06-22 13:26:23 -05:00
|
|
|
RUN apt-get clean -y && \
|
|
|
|
apt-get autoclean -y && \
|
|
|
|
apt-get autoremove -y && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/*
|
|
|
|
|
|
|
|
COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
|
|
|
|
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
|
|
|
|
COPY ["root/.vimrc", "/root/.vimrc"]
|
2019-01-31 01:05:52 -06:00
|
|
|
|
2019-11-20 09:39:49 -06:00
|
|
|
RUN ln /usr/bin/vim.tiny /usr/bin/vim
|
|
|
|
|
2019-06-22 13:26:23 -05:00
|
|
|
COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"]
|