acf465b43b
* Multi DB with namespace support, Introducing the database_global.json file for supporting accessing DB's in other namespaces for service running in linux host * Updates based on comments * Adding the j2 templates for database_config and database_global files. * Updating to retrieve the redis DIR's to be mounted from database_global.json file. * Additional check to see if asic.conf file exists before sourcing it. * Updates based on PR comments discussion. * Review comments update * Updates to the argument "-n" for namespace used in both context of parsing minigraph and multi DB access. * Update with the attribute "persistence_for_warm_boot" that was added to database_config.json file earlier. * Removing the database_config.json file to avioid confusion in future. We use the database_config.json.j2 file to generate database_config.json files dynamically. * Update the comments for sudo usage in docker_image_ctrl.j2 * Update with the new logic in PING PONG tests using sonic-db-cli. With this we wait till the PONG response is received when redis server is up. * Similar changes in swss and syncd scripts for the PING tests with sonic-db-cli * Updated with a missing , in the database_config.json.j2 file, Do pip install of j2cli in docker-base-buster.
103 lines
3.2 KiB
Django/Jinja
103 lines
3.2 KiB
Django/Jinja
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
|
{% if CONFIGURED_ARCH == "armhf" %}
|
|
FROM multiarch/debian-debootstrap:armhf-stretch
|
|
{% elif CONFIGURED_ARCH == "arm64" %}
|
|
FROM multiarch/debian-debootstrap:arm64-stretch
|
|
{% else %}
|
|
FROM debian:stretch
|
|
{% 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 \
|
|
less \
|
|
perl \
|
|
procps \
|
|
python \
|
|
python-pip \
|
|
rsyslog \
|
|
vim-tiny \
|
|
# Install dependencies of supervisor
|
|
python-pkg-resources \
|
|
python-meld3 \
|
|
# dependencies of redis-tools
|
|
libatomic1 \
|
|
libjemalloc1 \
|
|
liblua5.1-0 \
|
|
lua-bitop \
|
|
lua-cjson \
|
|
# common dependencies
|
|
libpython2.7 \
|
|
libdaemon0 \
|
|
libdbus-1-3 \
|
|
libjansson4
|
|
|
|
# ip and ifconfig utility missing in docker for arm arch
|
|
RUN apt-get -y install \
|
|
iproute2 \
|
|
net-tools
|
|
|
|
# For templating
|
|
RUN pip install j2cli
|
|
|
|
RUN mkdir -p /etc/supervisor /var/log/supervisor
|
|
|
|
RUN apt-get -y purge \
|
|
exim4 \
|
|
exim4-base \
|
|
exim4-config \
|
|
exim4-daemon-light
|
|
|
|
{% if docker_base_stretch_debs.strip() -%}
|
|
# Copy locally-built Debian package dependencies
|
|
{{ copy_files("debs/", docker_base_stretch_debs.split(' '), "/debs/") }}
|
|
|
|
# Install built Debian packages and implicitly install their dependencies
|
|
{{ install_debian_packages(docker_base_stretch_debs.split(' ')) }}
|
|
{%- endif %}
|
|
|
|
# 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/"]
|