[build]: Allow build-time specification of alternative docker registries (#8134)

Why I did it
Allows users to host their own local docker registries and utilize them via the REGISTRY_SERVER and REGISTRY_PORT environmental variables

How I did it
Only set REGISTRY_SERVER and REGISTRY_PORT in rules/config if they are unset.

How to verify it
Export environmental variables REGISTRY_SERVER and REGISTRY_PORT to an alternative docker registry. Export the environmental variable ENABLE_DOCKER_BASE_PULL to y.
Ensure the required sonic-slave docker images are not present locally, but are available in the docker registry
Execute make init and make configure
Confirm that the appropriate docker images were pulled from the appropriate docker registry, and not built locally
This commit is contained in:
jusherma 2021-07-14 01:27:25 -07:00 committed by GitHub
parent f17ca11669
commit ad3f861a77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,6 @@ SONIC_VERSION_CONTROL_COMPONENTS ?= none
# SONiC docker registry
#
# Uncomment below line to enable pulling sonic-slave docker from registry
# ENABLE_DOCKER_BASE_PULL = y
REGISTRY_PORT=443
REGISTRY_SERVER=sonicdev-microsoft.azurecr.io
# Set the env variable ENABLE_DOCKER_BASE_PULL = y to enable pulling sonic-slave docker from registry
REGISTRY_PORT ?= 443
REGISTRY_SERVER ?= sonicdev-microsoft.azurecr.io