mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-10-30 17:48:09 +00:00 
			
		
		
		
	[build]: add arch name in sonic-slave docker image
for exmaple, for arm64, the sonic-slave docker image name is sonic-slave-arm64-$(USER) for amd64, the docker image is kept as it is Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -23,6 +23,7 @@ target/ | ||||
|  | ||||
| # Autogenerated Dockerfiles | ||||
| sonic-slave*/Dockerfile | ||||
| sonic-slave*/Dockerfile.user | ||||
| dockers/*/Dockerfile | ||||
| platform/*/docker-*/Dockerfile | ||||
|  | ||||
|   | ||||
| @@ -72,9 +72,9 @@ SONIC_COMMON_FLAGS_LIST :=  $(CONFIGURED_PLATFORM) \ | ||||
|                             $(SONIC_PROFILING_ON) $(SONIC_ENABLE_SYNCD_RPC) | ||||
| SONIC_COMMON_DPKG_LIST  :=  debian/control debian/changelog debian/rules \ | ||||
|                             debian/compat debian/install debian/copyright | ||||
| SONIC_COMMON_BASE_FILES_LIST  := sonic-slave-jessie/Dockerfile.j2 sonic-slave-jessie/Dockerfile.user \ | ||||
|                                  sonic-slave-stretch/Dockerfile.j2 sonic-slave-stretch/Dockerfile.user \ | ||||
|                                  sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user | ||||
| SONIC_COMMON_BASE_FILES_LIST  := sonic-slave-jessie/Dockerfile.j2 sonic-slave-jessie/Dockerfile.user.j2 \ | ||||
|                                  sonic-slave-stretch/Dockerfile.j2 sonic-slave-stretch/Dockerfile.user.j2 \ | ||||
|                                  sonic-slave-buster/Dockerfile.j2 sonic-slave-buster/Dockerfile.user.j2 | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -91,7 +91,11 @@ endif | ||||
|  | ||||
| include rules/config | ||||
|  | ||||
| ifeq ($(CONFIGURED_ARCH),amd64) | ||||
| SLAVE_BASE_IMAGE = $(SLAVE_DIR) | ||||
| else | ||||
| SLAVE_BASE_IMAGE = $(SLAVE_DIR)-$(CONFIGURED_ARCH) | ||||
| endif | ||||
| SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER) | ||||
|  | ||||
| # Generate the version control build info | ||||
| @@ -101,6 +105,7 @@ $(shell SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ | ||||
|  | ||||
| # Generate the slave Dockerfile, and prepare build info for it | ||||
| $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) | ||||
| $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user) | ||||
| $(shell BUILD_SLAVE=y scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV)) | ||||
|  | ||||
| # Add the versions in the tag, if the version change, need to rebuild the slave | ||||
|   | ||||
| @@ -1,5 +1,9 @@ | ||||
| ARG slave_base_tag_ref=latest | ||||
| {%- if CONFIGURED_ARCH == "amd64" %} | ||||
| FROM sonic-slave-buster:${slave_base_tag_ref} | ||||
| {%- else %} | ||||
| FROM sonic-slave-buster-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} | ||||
| {%- endif %} | ||||
| 
 | ||||
| # Add user | ||||
| ARG user | ||||
| @@ -1,5 +1,9 @@ | ||||
| ARG slave_base_tag_ref=latest | ||||
| {%- if CONFIGURED_ARCH == "amd64" %} | ||||
| FROM sonic-slave-jessie:${slave_base_tag_ref} | ||||
| {%- else %} | ||||
| FROM sonic-slave-jessie-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} | ||||
| {%- endif %} | ||||
| 
 | ||||
| # Add user | ||||
| ARG user | ||||
| @@ -1,5 +1,9 @@ | ||||
| ARG slave_base_tag_ref=latest | ||||
| {%- if CONFIGURED_ARCH == "amd64"  %} | ||||
| FROM sonic-slave-stretch:${slave_base_tag_ref} | ||||
| {%- else %} | ||||
| FROM sonic-slave-stretch-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} | ||||
| {%- endif %} | ||||
| 
 | ||||
| # Add user | ||||
| ARG user | ||||
		Reference in New Issue
	
	Block a user
	 Guohan Lu
					Guohan Lu