Skip to content

Commit a412fe1

Browse files
authored
[dockers]: use docker --squash to build dockers (#273)
1 parent 53a9792 commit a412fe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slave.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ docker-start :
254254
# targets for building simple docker images that do not depend on any debian packages
255255
$(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker-start $$(addsuffix -load,$$(addprefix $(TARGET_PATH)/,$$($$*.gz_LOAD_DOCKERS)))
256256
$(HEADER)
257-
docker build --no-cache -t $* $($*.gz_PATH) $(LOG)
257+
docker build --squash --no-cache -t $* $($*.gz_PATH) $(LOG)
258258
docker save $* | gzip -c > $@
259259
$(FOOTER)
260260

@@ -268,7 +268,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .pl
268268
# Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs
269269
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++'))
270270
j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile
271-
docker build --no-cache -t $* $($*.gz_PATH) $(LOG)
271+
docker build --squash --no-cache -t $* $($*.gz_PATH) $(LOG)
272272
docker save $* | gzip -c > $@
273273
$(FOOTER)
274274

0 commit comments

Comments
 (0)