Skip to content

Commit

Permalink
[docker-restapi]: Avoid building RestAPI docker by default (#4018)
Browse files Browse the repository at this point in the history
Provide build option for RESTAPI docker
  • Loading branch information
sumukhatv authored and lguohan committed Jan 15, 2020
1 parent 918fdc6 commit ebb07d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ SONIC_BUILD_INSTRUCTION := make \
HTTP_PROXY=$(http_proxy) \
HTTPS_PROXY=$(https_proxy) \
SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \
SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \
EXTRA_JESSIE_TARGETS=$(EXTRA_JESSIE_TARGETS) \
$(SONIC_OVERRIDE_BUILD_VARS)

Expand Down
3 changes: 3 additions & 0 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ ENABLE_SFLOW = y

# ENABLE_MGMT_FRAMEWORK - build docker-sonic-mgt-framework for CLI and REST server support
ENABLE_MGMT_FRAMEWORK = y

# ENABLE_RESTAPI - build docker-sonic-restapi for configuring the switch using REST APIs
ENABLE_RESTAPI = n
2 changes: 2 additions & 0 deletions rules/docker-restapi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ $(DOCKER_RESTAPI)_PATH = $(DOCKERS_PATH)/$(DOCKER_RESTAPI_STEM)

$(DOCKER_RESTAPI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)

ifeq ($(ENABLE_RESTAPI), y)
SONIC_DOCKER_IMAGES += $(DOCKER_RESTAPI)
SONIC_STRETCH_DOCKERS += $(DOCKER_RESTAPI)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_RESTAPI)
endif

$(DOCKER_RESTAPI)_CONTAINER_NAME = rest-api
$(DOCKER_RESTAPI)_RUN_OPT += --cap-add NET_ADMIN --privileged -t
Expand Down
6 changes: 6 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))
ENABLE_SYSTEM_TELEMETRY = N
endif

ifeq ($(SONIC_ENABLE_RESTAPI),y)
ENABLE_RESTAPI = y
endif

ifeq ($(SONIC_ENABLE_SYNCD_RPC),y)
ENABLE_SYNCD_RPC = y
endif
Expand Down Expand Up @@ -190,6 +194,7 @@ $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)")
$(info "HTTP_PROXY" : "$(HTTP_PROXY)")
$(info "HTTPS_PROXY" : "$(HTTPS_PROXY)")
$(info "ENABLE_SYSTEM_TELEMETRY" : "$(ENABLE_SYSTEM_TELEMETRY)")
$(info "ENABLE_RESTAPI" : "$(ENABLE_RESTAPI)")
$(info "ENABLE_ZTP" : "$(ENABLE_ZTP)")
$(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)")
$(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)")
Expand Down Expand Up @@ -643,6 +648,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
export enable_system_telemetry="$(ENABLE_SYSTEM_TELEMETRY)"
export enable_restapi="$(ENABLE_RESTAPI)"
export enable_ztp="$(ENABLE_ZTP)"
export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)"
export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)"
Expand Down

0 comments on commit ebb07d9

Please sign in to comment.