2020-04-28 17:57:13 -05:00
{ % from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
{ % if CONFIGURED_ARCH = = "armhf" %}
FROM multiarch/debian-debootstrap:armhf-buster
{ % elif CONFIGURED_ARCH = = "arm64" %}
FROM multiarch/debian-debootstrap:arm64-buster
{ % else %}
FROM debian:buster
{ % endif %}
# 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
RUN while [ -n " $( find /usr/share/doc -depth -type d -empty -print -exec rmdir { } +) " ] ; do :; done && \
rm -rf \
/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" ]
{ % 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 %}
COPY [ "sources.list" , "/etc/apt/sources.list" ]
{ % endif %}
COPY [ "no_install_recommend_suggest" , "/etc/apt/apt.conf.d" ]
COPY [ "no-check-valid-until" , "/etc/apt/apt.conf.d" ]
# Update apt cache and
# pre-install fundamental packages
RUN apt-get update && \
apt-get -y install \
2020-09-08 21:30:14 -05:00
curl \
2020-04-28 17:57:13 -05:00
less \
perl \
procps \
python \
2020-05-08 23:24:05 -05:00
python-pip \
2020-05-17 06:26:50 -05:00
python3 \
python3-pip \
2020-04-28 17:57:13 -05:00
rsyslog \
vim-tiny \
# Install dependencies of supervisor
python-pkg-resources \
python-meld3 \
2020-09-08 21:30:14 -05:00
# Install dependencies of redis-tools
libatomic1 \
libjemalloc2 \
liblua5.1-0 \
lua-bitop \
lua-cjson \
2020-04-28 17:57:13 -05:00
# common dependencies
libpython2.7 \
libdaemon0 \
libdbus-1-3 \
2020-05-21 02:22:19 -05:00
libjansson4 \
2020-04-28 17:57:13 -05:00
# ip and ifconfig utility missing in docker for arm arch
iproute2 \
2020-05-21 02:22:19 -05:00
net-tools \
# for arm arch: Installing j2cli dependency package MarkupSafe from source relies on weeksetuptools and wheel
python-setuptools \
2020-07-08 12:27:05 -05:00
python-wheel \
# for processing/handling json files in bash environment
jq
2020-04-28 17:57:13 -05:00
2020-09-08 21:30:14 -05:00
# Install redis-tools
RUN curl -o redis-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r"
RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -y
RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb
2020-05-08 23:24:05 -05:00
# For templating
RUN pip install j2cli
2020-04-28 17:57:13 -05:00
RUN mkdir -p /etc/supervisor /var/log/supervisor
RUN apt-get -y purge \
exim4 \
exim4-base \
exim4-config \
exim4-daemon-light
{ % if docker_base_buster_debs.strip( ) -%}
# Copy locally-built Debian package dependencies
{ { copy_files( "debs/" , docker_base_buster_debs.split( ' ' ) , "/debs/" ) } }
# Install built Debian packages and implicitly install their dependencies
{ { install_debian_packages( docker_base_buster_debs.split( ' ' ) ) } }
{ %- endif %}
2020-05-14 11:42:58 -05:00
# Add support for supervisord to handle startup dependencies
RUN pip install supervisord-dependent-startup= = 1.4.0
2020-04-28 17:57:13 -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 && \
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" ]
RUN ln /usr/bin/vim.tiny /usr/bin/vim
COPY [ "etc/supervisor/supervisord.conf" , "/etc/supervisor/" ]