provide docker registry override in remaining scripts

As done with fe2768c73, provide a mechanism to override the docker
registry used for our remaining docker scripts.

docker.io continues to tighten control[1] on access to its registry.
Provide a mechanism within this script to utilize a different registry
for the base ubuntu image.

[1]: https://www.docker.com/blog/november-2024-updated-plans-announcement/

Tested:
- Confirmed script defaults still works as expected
- Confirmed the following also works now:
  export DOCKER_REG=public.ecr.aws/ubuntu
- Confirmed where applicable that this also works(fedora):
  export DOCKER_REG=public.ecr.aws/docker/library

Change-Id: Ib237183fb9f27573643783b3988cb00614749f4c
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/build-setup.sh b/build-setup.sh
index 1a3255f..f9b9df9 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -23,6 +23,9 @@
 #                     default is empty.
 #  CONTAINER_ONLY     Set to "true" if you only want to build the docker
 #                     container. The bitbake will not occur in this case.
+#  DOCKER_REG:        <optional, the URL of a docker registry to utilize
+#                     instead of the default docker hub
+#                     (ex. public.ecr.aws/ubuntu or public.ecr.aws/docker/library)
 #
 # Docker Image Build Variables:
 #  BITBAKE_OPTS       Set to "-c populate_sdk" or whatever other BitBake options
@@ -87,6 +90,7 @@
 UBUNTU_MIRROR=${UBUNTU_MIRROR:-""}
 ENV_LOCAL_CONF=${ENV_LOCAL_CONF:-""}
 container_only=${CONTAINER_ONLY:-false}
+docker_reg=${DOCKER_REG:-"docker.io"}
 
 # Docker Image Build Variables:
 build_dir=${build_dir:-${WORKSPACE}/build}
@@ -157,7 +161,7 @@
     fi
 
     Dockerfile=$(cat << EOF
-  FROM ${distro}:${img_tag}
+  FROM ${docker_reg}/${distro}:${img_tag}
 
   ${PROXY}
 
@@ -211,7 +215,7 @@
     fi
 
     Dockerfile=$(cat << EOF
-  FROM ${distro}:${img_tag}
+  FROM ${docker_reg}/${distro}:${img_tag}
 
   ${PROXY}
   ${MIRROR}