[202205] Remove apt package lists and make macro to clean up apt and python cache (#14377)
* Remove apt package lists and make macro to clean up apt and python cache Remove the apt package lists (`/var/lib/apt/lists`) from the docker containers. This saves about 100MB. Also, make a macro to clean up the apt and python cache that can then be used in all of the containers. This helps make the cleanup be consistent across all containers. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
This commit is contained in:
parent
e2ed36c764
commit
932d0f5391
@ -1,5 +1,5 @@
|
||||
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
||||
FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye
|
||||
{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
||||
@ -92,17 +92,12 @@ RUN apt-get -y purge \
|
||||
{{ install_debian_packages(docker_base_bullseye_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/* ~/.cache
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
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
|
||||
RUN ln -s /usr/bin/vim.tiny /usr/bin/vim
|
||||
|
||||
COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
||||
FROM {{ prefix }}multiarch/debian-debootstrap:armhf-buster
|
||||
{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %}
|
||||
@ -110,17 +110,12 @@ RUN apt-get -y purge \
|
||||
{{ install_debian_packages(docker_base_buster_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/* ~/.cache/
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
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
|
||||
RUN ln -s /usr/bin/vim.tiny /usr/bin/vim
|
||||
|
||||
COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-base-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
## Make apt-get non-interactive
|
||||
@ -45,8 +45,6 @@ COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
|
||||
## Clean up
|
||||
RUN apt-get purge -y \
|
||||
python3-dev \
|
||||
build-essential && \
|
||||
apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs /python-wheels ~/.cache
|
||||
build-essential
|
||||
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-base-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
## Make apt-get non-interactive
|
||||
@ -45,8 +45,6 @@ COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
|
||||
## Clean up
|
||||
RUN apt-get purge -y \
|
||||
python3-dev \
|
||||
build-essential && \
|
||||
apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs /python-wheels ~/.cache
|
||||
build-essential
|
||||
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -21,12 +21,10 @@ RUN apt-get install -y redis-tools redis-server
|
||||
{{ install_debian_packages(docker_database_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs ~/.cache && \
|
||||
sed -ri 's/^(save .*$)/# \1/g; \
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
# Configure redis
|
||||
RUN sed -ri 's/^(save .*$)/# \1/g; \
|
||||
s/^daemonize yes$/daemonize no/; \
|
||||
s/^logfile .*$/logfile ""/; \
|
||||
s/^# syslog-enabled no$/syslog-enabled no/; \
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -22,11 +22,7 @@ RUN apt-get update
|
||||
{{ install_debian_packages(docker_dhcp_relay_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["docker_init.sh", "start.sh", "/usr/bin/"]
|
||||
COPY ["docker-dhcp-relay.supervisord.conf.j2", "port-name-alias-map.txt.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -40,11 +40,7 @@ RUN useradd -u ${frr_user_uid} -g ${frr_user_gid} -M -s /bin/false frr
|
||||
|
||||
RUN chown -R ${frr_user_uid}:${frr_user_gid} /etc/frr/
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs ~/.cache /python-wheels
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["frr", "/usr/share/sonic/templates"]
|
||||
COPY ["docker_init.sh", "/usr/bin/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -30,13 +30,7 @@ RUN apt-get update
|
||||
{{ install_python_wheels(docker_lldp_whls.split(' ')) }}
|
||||
{% endif %}
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs \
|
||||
/python-wheels \
|
||||
~/.cache
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["docker-lldp-init.sh", "/usr/bin/"]
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -17,10 +17,7 @@ RUN apt-get update
|
||||
{{ install_debian_packages(docker_macsec_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -19,11 +19,7 @@ RUN apt-get update && \
|
||||
{{ install_debian_packages(docker_mux_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["docker-init.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
@ -1,11 +1,9 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-swss-layer-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
||||
|
||||
RUN echo
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@ -32,7 +30,6 @@ COPY ["restore_nat_entries.py", "/usr/bin/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["critical_processes", "/etc/supervisor"]
|
||||
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -60,11 +60,9 @@ RUN apt-get remove -y gcc
|
||||
# Clean up
|
||||
RUN apt-get purge -y \
|
||||
build-essential \
|
||||
python3-dev && \
|
||||
apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs ~/.cache
|
||||
python3-dev
|
||||
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["files/arp_update", "/usr/bin"]
|
||||
COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -73,13 +73,9 @@ RUN pip3 install libpci
|
||||
# Clean up
|
||||
RUN apt-get purge -y \
|
||||
build-essential \
|
||||
python3-dev && \
|
||||
apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs \
|
||||
/python-wheels \
|
||||
~/.cache
|
||||
python3-dev
|
||||
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["lm-sensors.sh", "/usr/bin/"]
|
||||
COPY ["docker-pmon.supervisord.conf.j2", "docker_init.j2", "/usr/share/sonic/templates/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -25,11 +25,7 @@ RUN apt-get -y install radvd
|
||||
{{ install_debian_packages(docker_router_advertiser_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["docker-init.sh", "/usr/bin/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-swss-layer-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -20,10 +20,7 @@ RUN apt-get update && \
|
||||
{{ install_debian_packages(docker_sflow_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
RUN sed -ri '/^DAEMON_ARGS=""/c DAEMON_ARGS="-c /var/log/hsflowd.crash"' /etc/init.d/hsflowd
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python3_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python3_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -60,12 +60,9 @@ RUN python3 -m sonic_ax_impl install
|
||||
RUN apt-get -y purge \
|
||||
python3-dev \
|
||||
gcc \
|
||||
make && \
|
||||
apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y --purge && \
|
||||
find / | grep -E "__pycache__" | xargs rm -rf && \
|
||||
rm -rf /debs /python-wheels ~/.cache
|
||||
make
|
||||
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["snmp_yml_to_configdb.py", "/usr/bin/"]
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -17,23 +18,17 @@ RUN pip3 install connexion==2.7.0 \
|
||||
six==1.11.0 \
|
||||
urllib3==1.26.5
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
# Copy locally-built Debian package dependencies
|
||||
{{ copy_files("debs/", docker_sonic_mgmt_framework_debs.split(' '), "/debs/") }}
|
||||
|
||||
RUN dpkg -i \
|
||||
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor %}
|
||||
# Install locally-built Debian packages and implicitly install their dependencies
|
||||
{{ install_debian_packages(docker_sonic_mgmt_framework_debs.split(' ')) }}
|
||||
|
||||
COPY ["start.sh", "rest-server.sh", "/usr/bin/"]
|
||||
COPY ["mgmt_vars.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
||||
RUN apt-get remove -y g++ python3-dev
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs ~/.cache
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -18,10 +18,7 @@ RUN apt-get update
|
||||
{{ install_debian_packages(docker_sonic_p4rt_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "p4rt.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
@ -17,8 +17,7 @@ RUN apt-get update
|
||||
{{ install_debian_packages( docker_sonic_restapi_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "restapi.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -21,10 +21,7 @@ RUN apt-get update
|
||||
{{ install_debian_packages(docker_sonic_telemetry_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean - && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "telemetry.sh", "dialout.sh", "/usr/bin/"]
|
||||
COPY ["telemetry_vars.j2", "/usr/share/sonic/templates/"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
## Make apt-get non-interactive
|
||||
@ -16,9 +16,6 @@ RUN apt-get install iputils-ping
|
||||
{{ install_debian_packages(docker_swss_layer_bullseye_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
## Make apt-get non-interactive
|
||||
@ -16,9 +16,6 @@ RUN apt-get install iputils-ping
|
||||
{{ install_debian_packages(docker_swss_layer_buster_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -17,10 +17,7 @@ RUN apt-get update
|
||||
{{ install_debian_packages(docker_teamd_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
@ -37,3 +37,10 @@ COPY \
|
||||
{%- endfor %}
|
||||
{{ dest }}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro cleanup_apt_and_python_cache() -%}
|
||||
RUN apt-get clean -y && \
|
||||
apt-get autoclean -y && \
|
||||
apt-get autoremove -y && \
|
||||
rm -rf /debs /python-wheels /tmp/* ~/.cache /var/lib/apt/lists/*
|
||||
{%- endmacro %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -10,11 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_syncd_brcm_dnx_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
{{ copy_files("debs/", docker_syncd_brcm_dnx_debs.split(' '), "/debs/") }}
|
||||
|
||||
# Install locally-built Debian packages and implicitly install their dependencies
|
||||
{{ install_debian_packages(docker_syncd_brcm_dnx_debs.split(' ')) }}
|
||||
@ -32,8 +28,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["critical_processes", "/etc/supervisor/"]
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -10,11 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_syncd_brcm_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
{{ copy_files("debs/", docker_syncd_brcm_debs.split(' '), "/debs/") }}
|
||||
|
||||
# Install locally-built Debian packages and implicitly install their dependencies
|
||||
{{ install_debian_packages(docker_syncd_brcm_debs.split(' ')) }}
|
||||
@ -32,8 +28,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["critical_processes", "/etc/supervisor/"]
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -36,8 +37,6 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["files/dsserve", "/usr/bin/"]
|
||||
RUN chmod +x /usr/bin/dsserve
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-init.sh"]
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -34,8 +35,6 @@ COPY ["supervisord.conf.j2", "/usr/share/sonic/templates"]
|
||||
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-init.sh"]
|
||||
|
@ -6,6 +6,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y gnupg
|
||||
COPY ["sonic-dev.gpg.key", "/etc/apt/"]
|
||||
RUN apt-key add /etc/apt/sonic-dev.gpg.key
|
||||
|
@ -1,3 +1,4 @@
|
||||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files, cleanup_apt_and_python_cache %}
|
||||
FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
|
||||
|
||||
ARG docker_container_name
|
||||
@ -11,16 +12,11 @@ RUN apt-get update
|
||||
|
||||
RUN apt-get install -f -y libcap2-bin
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_syncd_vs_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
# Copy locally-built Debian package dependencies
|
||||
{{ copy_files("debs/", docker_syncd_vs_debs.split(' '), "/debs/") }}
|
||||
|
||||
RUN dpkg -i \
|
||||
{% for deb in docker_syncd_vs_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor %} || apt-get install -f -y
|
||||
# Install locally-built Debian packages and implicitly install their dependencies
|
||||
{{ install_debian_packages(docker_syncd_vs_debs.split(' ')) }}
|
||||
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
|
||||
@ -28,8 +24,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
COPY ["critical_processes", "/etc/supervisor/"]
|
||||
|
||||
## Clean up
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
{{ cleanup_apt_and_python_cache() }}
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/supervisord"]
|
||||
|
Loading…
Reference in New Issue
Block a user