File tree Expand file tree Collapse file tree 6 files changed +22
-4
lines changed Expand file tree Collapse file tree 6 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ target/
2323
2424# Autogenerated Dockerfiles
2525sonic-slave * /Dockerfile
26+ sonic-slave * /Dockerfile.user
2627dockers /* /Dockerfile
2728platform /* /docker- * /Dockerfile
2829
Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ SONIC_COMMON_FLAGS_LIST := $(CONFIGURED_PLATFORM) \
7272 $(SONIC_PROFILING_ON) $(SONIC_ENABLE_SYNCD_RPC)
7373SONIC_COMMON_DPKG_LIST := debian/control debian/changelog debian/rules \
7474 debian/compat debian/install debian/copyright
75- SONIC_COMMON_BASE_FILES_LIST := sonic-slave-jessie/Dockerfile.j2 sonic-slave-jessie/Dockerfile.user \
76- sonic-slave-stretch/Dockerfile.j2 sonic-slave-stretch/Dockerfile.user \
77- sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user
75+ SONIC_COMMON_BASE_FILES_LIST := sonic-slave-jessie/Dockerfile.j2 sonic-slave-jessie/Dockerfile.user.j2 \
76+ sonic-slave-stretch/Dockerfile.j2 sonic-slave-stretch/Dockerfile.user.j2 \
77+ sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user.j2
7878
7979
8080
@@ -181,7 +181,7 @@ define GET_MOD_DEP_SHA
181181 $($(dfile)_DEP_FLAGS_FILE) $($(dfile)_MOD_HASH_FILE) $($(dfile)_SMOD_HASH_FILE)) )
182182 $(eval $(1)_DEP_FILES_MISSING := $(filter-out $(wildcard $($(1)_DEP_MOD_SHA_FILES)),$($(1)_DEP_MOD_SHA_FILES)) )
183183 $(if $($(1)_DEP_FILES_MISSING), $(warning "[ DPKG ] Dependecy file(s) are not found for $(1) : $($(1)_DEP_FILES_MISSING)))
184-
184+
185185 $(eval $(1)_DEP_MOD_SHA := $(shell git hash-object $($(1)_DEP_MOD_SHA_FILES) \
186186 | sha1sum | awk '{print substr($$1,0,23);}'))
187187endef
Original file line number Diff line number Diff line change 9191
9292include rules/config
9393
94+ ifeq ($(CONFIGURED_ARCH),amd64)
9495SLAVE_BASE_IMAGE = $(SLAVE_DIR)
96+ else
97+ SLAVE_BASE_IMAGE = $(SLAVE_DIR)-$(CONFIGURED_ARCH)
98+ endif
9599SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER)
96100
97101# Generate the version control build info
@@ -101,6 +105,7 @@ $(shell SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \
101105
102106# Generate the slave Dockerfile, and prepare build info for it
103107$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile)
108+ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user)
104109$(shell BUILD_SLAVE=y scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV))
105110
106111# Add the versions in the tag, if the version change, need to rebuild the slave
Original file line number Diff line number Diff line change 11ARG slave_base_tag_ref=latest
2+ {% - if CONFIGURED_ARCH == "amd64" %}
23FROM sonic-slave-buster:${slave_base_tag_ref}
4+ {% - else %}
5+ FROM sonic-slave-buster-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref}
6+ {% - endif %}
37
48# Add user
59ARG user
Original file line number Diff line number Diff line change 11ARG slave_base_tag_ref=latest
2+ {% - if CONFIGURED_ARCH == "amd64" %}
23FROM sonic-slave-jessie:${slave_base_tag_ref}
4+ {% - else %}
5+ FROM sonic-slave-jessie-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref}
6+ {% - endif %}
37
48# Add user
59ARG user
Original file line number Diff line number Diff line change 11ARG slave_base_tag_ref=latest
2+ {% - if CONFIGURED_ARCH == "amd64" %}
23FROM sonic-slave-stretch:${slave_base_tag_ref}
4+ {% - else %}
5+ FROM sonic-slave-stretch-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref}
6+ {% - endif %}
37
48# Add user
59ARG user
You can’t perform that action at this time.
0 commit comments