From a412fe16c4f03f1a33858756815195c8089e130b Mon Sep 17 00:00:00 2001 From: lguohan Date: Tue, 7 Feb 2017 08:36:19 -0800 Subject: [PATCH] [dockers]: use docker --squash to build dockers (#273) --- slave.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slave.mk b/slave.mk index e34d932c1a..a13178bb58 100644 --- a/slave.mk +++ b/slave.mk @@ -254,7 +254,7 @@ docker-start : # targets for building simple docker images that do not depend on any debian packages $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker-start $$(addsuffix -load,$$(addprefix $(TARGET_PATH)/,$$($$*.gz_LOAD_DOCKERS))) $(HEADER) - docker build --no-cache -t $* $($*.gz_PATH) $(LOG) + docker build --squash --no-cache -t $* $($*.gz_PATH) $(LOG) docker save $* | gzip -c > $@ $(FOOTER) @@ -268,7 +268,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .pl # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile - docker build --no-cache -t $* $($*.gz_PATH) $(LOG) + docker build --squash --no-cache -t $* $($*.gz_PATH) $(LOG) docker save $* | gzip -c > $@ $(FOOTER)