[build]: only build dockers needed by installers (#2771)

Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
lguohan 2019-04-11 19:28:41 -07:00 committed by GitHub
parent 0a6dd8800f
commit 158531b48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -472,8 +472,10 @@ SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES))
# Build stretch docker images only in stretch slave docker,
# jessie docker images only in jessie slave docker
DOCKER_IMAGES_FOR_INSTALLERS := $(sort $(foreach installer,$(SONIC_INSTALLERS),$($(installer)_DOCKERS)))
ifeq ($(BLDENV),stretch)
DOCKER_IMAGES := $(SONIC_STRETCH_DOCKERS)
SONIC_STRETCH_DOCKERS_FOR_INSTALLERS = $(filter $(SONIC_STRETCH_DOCKERS),$(DOCKER_IMAGES_FOR_INSTALLERS))
else
DOCKER_IMAGES := $(filter-out $(SONIC_STRETCH_DOCKERS), $(SONIC_DOCKER_IMAGES))
endif
@ -681,7 +683,7 @@ all : .platform $$(addprefix $(TARGET_PATH)/,$$(SONIC_ALL))
stretch : $$(addprefix $(DEBS_PATH)/,$$(SONIC_STRETCH_DEBS)) \
$$(addprefix $(FILES_PATH)/,$$(SONIC_STRETCH_FILES)) \
$$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DOCKERS))
$$(addprefix $(TARGET_PATH)/,$$(SONIC_STRETCH_DOCKERS_FOR_INSTALLERS))
###############################################################################