2022-03-14 05:09:20 -05:00
|
|
|
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
|
2021-04-18 10:17:57 -05:00
|
|
|
{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
2022-03-14 05:09:20 -05:00
|
|
|
FROM {{ prefix }}multiarch/debian-debootstrap:armhf-jessie
|
2021-04-18 10:17:57 -05:00
|
|
|
{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
2022-03-14 05:09:20 -05:00
|
|
|
FROM {{ prefix }}multiarch/debian-debootstrap:arm64-jessie
|
2019-07-26 00:06:41 -05:00
|
|
|
{% else %}
|
2022-03-14 05:09:20 -05:00
|
|
|
FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:jessie
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
2017-02-12 20:02:04 -06:00
|
|
|
|
2019-03-27 01:46:39 -05:00
|
|
|
## Remove retired jessie-updates repo
|
2019-07-26 00:06:41 -05:00
|
|
|
RUN sed -i '/http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
|
2019-03-27 01:46:39 -05:00
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
# Clean documentation in FROM image
|
2017-02-12 20:02:04 -06:00
|
|
|
RUN find /usr/share/doc -depth \( -type f -o -type l \) ! -name copyright | xargs rm || true
|
2017-07-06 12:32:27 -05:00
|
|
|
|
|
|
|
# Clean doc directories that are empty or only contain empty directories
|
2017-02-12 20:02:04 -06:00
|
|
|
RUN while [ -n "$(find /usr/share/doc -depth -type d -empty -print -exec rmdir {} +)" ]; do :; done
|
2017-05-08 17:43:31 -05:00
|
|
|
RUN rm -rf \
|
|
|
|
/usr/share/man/* \
|
|
|
|
/usr/share/groff/* \
|
|
|
|
/usr/share/info/* \
|
|
|
|
/usr/share/lintian/* \
|
|
|
|
/usr/share/linda/* \
|
|
|
|
/var/cache/man/* \
|
|
|
|
/usr/share/locale/*
|
2017-02-12 20:02:04 -06:00
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
# Make apt-get non-interactive
|
2017-02-16 23:48:49 -06:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
# Configure data sources for apt/dpkg
|
2017-05-08 17:43:31 -05:00
|
|
|
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"]
|
2020-01-07 17:52:49 -06:00
|
|
|
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"]
|
2019-07-26 00:06:41 -05:00
|
|
|
{% else %}
|
2018-05-02 13:46:21 -05:00
|
|
|
COPY ["sources.list", "/etc/apt/sources.list"]
|
2019-07-26 00:06:41 -05:00
|
|
|
{% endif %}
|
2018-05-02 13:46:21 -05:00
|
|
|
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
|
2017-06-08 04:47:53 -05:00
|
|
|
RUN apt-get update
|
2017-02-12 20:02:04 -06:00
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
# Pre-install fundamental packages
|
2017-05-08 17:43:31 -05:00
|
|
|
RUN apt-get -y install \
|
|
|
|
vim-tiny \
|
|
|
|
perl \
|
2017-05-11 20:46:11 -05:00
|
|
|
python \
|
2020-11-20 01:41:32 -06:00
|
|
|
python-pip \
|
2019-03-27 01:46:39 -05:00
|
|
|
rsyslog \
|
2017-05-11 20:46:11 -05:00
|
|
|
less
|
2017-02-12 20:02:04 -06:00
|
|
|
|
2023-12-28 06:53:49 -06:00
|
|
|
COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
|
2017-05-08 17:43:31 -05:00
|
|
|
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
|
2017-05-11 20:46:11 -05:00
|
|
|
COPY ["root/.vimrc", "/root/.vimrc"]
|
2017-02-12 20:02:04 -06:00
|
|
|
|
2020-12-25 23:29:25 -06:00
|
|
|
RUN pip install --upgrade 'pip<21'
|
|
|
|
RUN apt-get purge -y python-pip
|
|
|
|
|
2020-11-20 01:41:32 -06:00
|
|
|
# Some Python packages require setuptools (or pkg_resources, which is supplied by setuptools)
|
|
|
|
# and some require wheel
|
|
|
|
RUN pip install setuptools==40.8.0
|
|
|
|
RUN pip install wheel
|
|
|
|
|
|
|
|
# Install supervisor
|
|
|
|
RUN pip install supervisor>=3.4.0
|
2017-07-06 12:32:27 -05:00
|
|
|
|
2022-12-08 10:58:35 -06:00
|
|
|
RUN mkdir -p /etc/supervisor/conf.d
|
2017-07-06 12:32:27 -05:00
|
|
|
RUN mkdir -p /var/log/supervisor
|
|
|
|
|
|
|
|
COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"]
|
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
RUN apt-get -y purge \
|
|
|
|
exim4 \
|
|
|
|
exim4-base \
|
|
|
|
exim4-config \
|
2017-02-12 20:02:04 -06:00
|
|
|
exim4-daemon-light
|
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
{% if docker_base_debs.strip() -%}
|
|
|
|
# Copy built Debian packages
|
|
|
|
{%- for deb in docker_base_debs.split(' ') %}
|
|
|
|
COPY debs/{{ deb }} debs/
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
# Install built Debian packages and implicitly install their dependencies
|
|
|
|
{%- for deb in docker_base_debs.split(' ') %}
|
|
|
|
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt debs/{{ deb }}
|
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
{% if docker_base_dbgs.strip() -%}
|
|
|
|
# Install common debug-packages
|
|
|
|
{%- for dbg_pkg in docker_base_dbgs.split(' ') %}
|
|
|
|
RUN apt-get -y install {{ dbg_pkg }}
|
2017-02-21 21:04:43 -06:00
|
|
|
{%- endfor %}
|
2017-05-11 20:46:11 -05:00
|
|
|
{% else %}
|
|
|
|
RUN ln /usr/bin/vim.tiny /usr/bin/vim
|
2017-07-06 12:32:27 -05:00
|
|
|
{%- endif %}
|
|
|
|
|
2019-04-29 19:21:24 -05:00
|
|
|
# Remove python3.4
|
|
|
|
# Note: if later python3 is required by more docker images, consider install homebrew python3 here instead of in SNMP image only
|
|
|
|
RUN apt-get purge -y libpython3.4-minimal
|
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
# Clean up apt
|
|
|
|
# Remove /var/lib/apt/lists/*, could be obsoleted for derived images
|
|
|
|
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
|
|
|
RUN rm -rf /var/lib/apt/lists/*
|
2017-02-21 21:04:43 -06:00
|
|
|
|
2017-07-06 12:32:27 -05:00
|
|
|
RUN rm -rf /tmp/*
|