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-rootfs-size-docker.sh b/build-rootfs-size-docker.sh
index 4acd278..056f1ea 100755
--- a/build-rootfs-size-docker.sh
+++ b/build-rootfs-size-docker.sh
@@ -9,6 +9,9 @@
# UBUNTU_MIRROR: [optional] The URL of a mirror of Ubuntu to override the
# default ones in /etc/apt/sources.list
# default is empty, and no mirror is used.
+# DOCKER_REG: <optional, the URL of a docker registry to utilize
+# instead of the default docker hub
+# (ex. public.ecr.aws/ubuntu)
# http_proxy: The HTTP address of the proxy server to connect to.
# Default: "", proxy is not setup if this is not set
@@ -19,6 +22,7 @@
DOCKER_IMG_NAME=${DOCKER_IMG_NAME:-"openbmc/ubuntu-rootfs-size"}
DISTRO=${DISTRO:-"ubuntu:bionic"}
+docker_reg=${DOCKER_REG:-"docker.io"}
PROXY=""
@@ -40,7 +44,7 @@
fi
Dockerfile=$(cat << EOF
-FROM ${DISTRO}
+FROM ${docker_reg}/${DISTRO}
${PROXY}
${MIRROR}