From 3c852b366029e5fbb354fa7c0deb8c2939b8ffea Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 31 Jan 2024 17:37:06 -0800 Subject: [PATCH] Add Bookworm swss-layer Signed-off-by: Saikrishna Arcot --- .../docker-swss-layer-bookworm/Dockerfile.j2 | 24 +++++++++++++++++++ rules/docker-swss-layer-bookworm.dep | 9 +++++++ rules/docker-swss-layer-bookworm.mk | 14 +++++++++++ 3 files changed, 47 insertions(+) create mode 100644 dockers/docker-swss-layer-bookworm/Dockerfile.j2 create mode 100644 rules/docker-swss-layer-bookworm.dep create mode 100644 rules/docker-swss-layer-bookworm.mk diff --git a/dockers/docker-swss-layer-bookworm/Dockerfile.j2 b/dockers/docker-swss-layer-bookworm/Dockerfile.j2 new file mode 100644 index 000000000000..4c9b578ebc33 --- /dev/null +++ b/dockers/docker-swss-layer-bookworm/Dockerfile.j2 @@ -0,0 +1,24 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +RUN apt-get install iputils-ping + +{% if docker_swss_layer_bookworm_debs.strip() -%} +# Copy locally-built Debian package dependencies +{{ copy_files("debs/", docker_swss_layer_bookworm_debs.split(' '), "/debs/") }} + +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_swss_layer_bookworm_debs.split(' ')) }} +{%- endif %} + +RUN apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get autoremove -y && \ + rm -rf /debs + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/rules/docker-swss-layer-bookworm.dep b/rules/docker-swss-layer-bookworm.dep new file mode 100644 index 000000000000..9442cd4f40d3 --- /dev/null +++ b/rules/docker-swss-layer-bookworm.dep @@ -0,0 +1,9 @@ + +DPATH := $($(DOCKER_SWSS_LAYER_BOOKWORM)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-swss-layer-bookworm.mk rules/docker-swss-layer-bookworm.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SWSS_LAYER_BOOKWORM)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SWSS_LAYER_BOOKWORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SWSS_LAYER_BOOKWORM)_DEP_FILES := $(DEP_FILES) diff --git a/rules/docker-swss-layer-bookworm.mk b/rules/docker-swss-layer-bookworm.mk new file mode 100644 index 000000000000..a485289bac11 --- /dev/null +++ b/rules/docker-swss-layer-bookworm.mk @@ -0,0 +1,14 @@ +# bookworm-based docker image for sonic swss layer + +DOCKER_SWSS_LAYER_BOOKWORM= docker-swss-layer-bookworm.gz +$(DOCKER_SWSS_LAYER_BOOKWORM)_PATH = $(DOCKERS_PATH)/docker-swss-layer-bookworm + +$(DOCKER_SWSS_LAYER_BOOKWORM)_DEPENDS += $(SWSS) +$(DOCKER_SWSS_LAYER_BOOKWORM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) + +$(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS) \ + $(SWSS_DBG) +$(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES) + +SONIC_DOCKER_IMAGES += $(DOCKER_SWSS_LAYER_BOOKWORM) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_SWSS_LAYER_BOOKWORM)