sonic-buildimage/rules/docker-dhcp-server.mk
Yaqiang Zhu 76b7cb8b64
[dhcp_server] Add dhcp_server container (#14031)
Why I did it
Add dhcp_server ipv4 feature to SONiC.
HLD: sonic-net/SONiC#1282

How I did it
To be clarify: This container is disabled by INCLUDE_DHCP_SERVER = n for now, which would cause container not build.

Add INCLUDE_DHCP_SERVER to indicate whether to build dhcp_server container
Add docker file for dhcp_server, build and install kea-dhcp4 inside container
Add template file for dhcp_server container services.
Add entry for dhcp_server to FEATURE table in config_db.
How to verify it
Build image with INCLUDE_DHCP_SERVER = y to verify:

Image can be install successfully without crush.
By config feature state dhcp_server enabled to enable dhcp_server.
2023-09-11 09:15:56 -07:00

53 lines
1.9 KiB
Makefile

# Docker image for DHCP server
DOCKER_DHCP_SERVER_STEM = docker-dhcp-server
DOCKER_DHCP_SERVER = $(DOCKER_DHCP_SERVER_STEM).gz
DOCKER_DHCP_SERVER_DBG = $(DOCKER_DHCP_SERVER_STEM)-$(DBG_IMAGE_MARK).gz
$(DOCKER_DHCP_SERVER)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_SERVER_STEM)
$(DOCKER_DHCP_SERVER)_DEPENDS = $(SWSS) $(LIBSWSSCOMMON) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_DHCP_SERVER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_DHCP_SERVER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)
$(DOCKER_DHCP_SERVER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_DHCP_SERVER)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3)
$(DOCKER_DHCP_SERVER)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON)
SONIC_DOCKER_IMAGES += $(DOCKER_DHCP_SERVER)
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_DHCP_SERVER_DBG)
ifeq ($(INCLUDE_KUBERNETES),y)
$(DOCKER_DHCP_SERVER)_DEFAULT_FEATURE_OWNER = kube
endif
$(DOCKER_DHCP_SERVER)_DEFAULT_FEATURE_STATE_ENABLED = y
ifeq ($(INCLUDE_DHCP_SERVER), y)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
SONIC_PACKAGES_LOCAL += $(DOCKER_DHCP_SERVER_DBG)
else
SONIC_PACKAGES_LOCAL += $(DOCKER_DHCP_SERVER)
endif
endif
$(DOCKER_DHCP_SERVER)_CONTAINER_NAME = dhcp_server
$(DOCKER_DHCP_SERVER)_VERSION = 1.0.0
$(DOCKER_DHCP_SERVER)_PACKAGE_NAME = dhcp-server
$(DOCKER_MACSEC)_SERVICE_REQUIRES = updategraph
$(DOCKER_MACSEC)_SERVICE_AFTER = swss syncd
$(DOCKER_DHCP_SERVER)_CONTAINER_PRIVILEGED = true
$(DOCKER_DHCP_SERVER)_CONTAINER_VOLUMES += /etc/sonic:/etc/sonic:ro
$(DOCKER_DHCP_SERVER)_CONTAINER_TMPFS += /tmp/
$(DOCKER_DHCP_SERVER)_CONTAINER_TMPFS += /var/tmp/
$(DOCKER_DHCP_SERVER)_CLI_CONFIG_PLUGIN = /cli/config/plugins/dhcp_server.py
$(DOCKER_DHCP_SERVER)_CLI_SHOW_PLUGIN = /cli/show/plugins/show_dhcp_server.py
$(DOCKER_DHCP_SERVER)_CLI_CLEAR_PLUGIN = /cli/clear/plugins/clear_dhcp_server.py
$(DOCKER_DHCP_SERVER)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)