Skip to content

Commit 1bcd54d

Browse files
stepanblyschaklguohan
authored andcommitted
[build]: Upgrade docker to 18.09 in stretch slave (#3049)
Also add an option to use docker buildkit for image build Signed-off-by: Stepan Blyschak <[email protected]>
1 parent 69b8ad7 commit 1bcd54d

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

Makefile.work

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ SONIC_BUILD_INSTRUCTION := make \
117117
PASSWORD=$(PASSWORD) \
118118
USERNAME=$(USERNAME) \
119119
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS) \
120+
SONIC_USE_DOCKER_BUILDKIT=$(SONIC_USE_DOCKER_BUILDKIT) \
120121
VS_PREPARE_MEM=$(VS_PREPARE_MEM) \
121122
KERNEL_PROCURE_METHOD=$(KERNEL_PROCURE_METHOD) \
122123
HTTP_PROXY=$(http_proxy) \

rules/config

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ SONIC_CONFIG_BUILD_JOBS = 1
1616
# Corresponding -j argument will be passed to make/dpkg commands that build separate packages
1717
SONIC_CONFIG_MAKE_JOBS = $(shell nproc)
1818

19+
# SONIC_USE_DOCKER_BUILDKIT - use docker buildkit for build.
20+
# If set to y SONiC build system will set environment variable DOCKER_BUILDKIT=1
21+
# to enable docker buildkit.
22+
# This options will speed up docker image build time.
23+
# NOTE: SONIC_USE_DOCKER_BUILDKIT will produce larger installable SONiC image
24+
# because of a docker bug (more details: https://github.com/moby/moby/issues/38903)
25+
# SONIC_USE_DOCKER_BUILDKIT = y
26+
1927
# SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD - use native dockerd for build.
2028
# If set to y SONiC build container will use native dockerd instead of dind for faster build
2129
# SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD = y

slave.mk

+7
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ $(info "CONFIGURED_PLATFORM" : "$(if $(PLATFORM),$(PLATFORM),$(CONFI
151151
$(info "SONIC_CONFIG_PRINT_DEPENDENCIES" : "$(SONIC_CONFIG_PRINT_DEPENDENCIES)")
152152
$(info "SONIC_BUILD_JOBS" : "$(SONIC_BUILD_JOBS)")
153153
$(info "SONIC_CONFIG_MAKE_JOBS" : "$(SONIC_CONFIG_MAKE_JOBS)")
154+
$(info "SONIC_USE_DOCKER_BUILDKIT" : "$(SONIC_USE_DOCKER_BUILDKIT)")
154155
$(info "USERNAME" : "$(USERNAME)")
155156
$(info "PASSWORD" : "$(PASSWORD)")
156157
$(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)")
@@ -175,6 +176,12 @@ $(info "BLDENV" : "$(BLDENV)")
175176
$(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)")
176177
$(info )
177178

179+
ifeq ($(SONIC_USE_DOCKER_BUILDKIT),y)
180+
$(warning "Using SONIC_USE_DOCKER_BUILDKIT will produce larger installable SONiC image because of a docker bug (more details: https://github.com/moby/moby/issues/38903)")
181+
export DOCKER_BUILDKIT=1
182+
endif
183+
184+
178185
###############################################################################
179186
## Generic rules section
180187
## All rules must go after includes for propper targets expansion

sonic-slave-stretch/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,5 +326,5 @@ RUN add-apt-repository \
326326
$(lsb_release -cs) \
327327
stable"
328328
RUN apt-get update
329-
RUN apt-get install -y docker-ce=17.03.2~ce-0~debian-stretch
329+
RUN apt-get install -y docker-ce=5:18.09.5~3-0~debian-stretch
330330
RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker

0 commit comments

Comments
 (0)