From bf5f3650e5ce49b1ce2f7642dfd3666d88817126 Mon Sep 17 00:00:00 2001 From: Prabhu Sreenivasan Date: Fri, 9 Aug 2019 11:09:15 -0700 Subject: [PATCH] added support for sonic-cli console --- .../docker-sonic-mgmt-framework/base_image_files/sonic-cli | 4 ++++ rules/docker-sonic-mgmt-framework.mk | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 dockers/docker-sonic-mgmt-framework/base_image_files/sonic-cli diff --git a/dockers/docker-sonic-mgmt-framework/base_image_files/sonic-cli b/dockers/docker-sonic-mgmt-framework/base_image_files/sonic-cli new file mode 100755 index 000000000000..6675e3badbaf --- /dev/null +++ b/dockers/docker-sonic-mgmt-framework/base_image_files/sonic-cli @@ -0,0 +1,4 @@ +#!/bin/bash + +docker exec -it mgmt-framework /usr/sbin/cli/clish_start "$@" + diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index 8e973da313b4..7daed62680c4 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -7,11 +7,11 @@ DOCKER_MGMT-FRAMEWORK_DBG = $(DOCKER_MGMT-FRAMEWORK_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_MGMT-FRAMEWORK)_PATH = $(DOCKERS_PATH)/$(DOCKER_MGMT-FRAMEWORK_STEM) $(DOCKER_MGMT-FRAMEWORK)_DEPENDS += $(REDIS_TOOLS) $(SONIC_MGMT-FRAMEWORK) -#$(DOCKER_MGMT-FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) +$(DOCKER_MGMT-FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) SONIC_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK) $(DOCKER_MGMT-FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) -#$(DOCKER_MGMT-FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) +$(DOCKER_MGMT-FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK) SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT-FRAMEWORK) @@ -19,4 +19,7 @@ SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT-FRAMEWORK) $(DOCKER_MGMT-FRAMEWORK)_CONTAINER_NAME = mgmt-framework $(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += --net=host --privileged -t $(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += -v /etc:/host_etc:ro + +$(DOCKER_MGMT-FRAMEWORK)_BASE_IMAGE_FILES += sonic-cli:/usr/bin/sonic-cli