From 935460e549139f44107a5ba51d3464a868a69936 Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Fri, 2 Apr 2021 09:44:52 -0700 Subject: [PATCH] osbuilder: update dockerfiles to utilize IMAGE_REGISTRY While we introduced IMAGE_REGISTRY, we didn't actually update the corresponding Dockerfiles to utilize it. Let's add Fixes: #1622 Signed-off-by: Eric Ernst --- tools/osbuilder/image-builder/Dockerfile | 4 ++-- tools/osbuilder/rootfs-builder/alpine/Dockerfile.in | 3 ++- tools/osbuilder/rootfs-builder/centos/Dockerfile.in | 3 ++- tools/osbuilder/rootfs-builder/clearlinux/Dockerfile.in | 3 ++- tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in | 3 ++- tools/osbuilder/rootfs-builder/debian/Dockerfile.in | 3 ++- tools/osbuilder/rootfs-builder/fedora/Dockerfile.in | 4 ++-- tools/osbuilder/rootfs-builder/gentoo/Dockerfile.in | 3 ++- tools/osbuilder/rootfs-builder/suse/Dockerfile.in | 3 ++- tools/osbuilder/rootfs-builder/template/Dockerfile.template | 3 ++- tools/osbuilder/rootfs-builder/ubuntu/Dockerfile-aarch64.in | 3 ++- tools/osbuilder/rootfs-builder/ubuntu/Dockerfile.in | 3 ++- 12 files changed, 24 insertions(+), 14 deletions(-) diff --git a/tools/osbuilder/image-builder/Dockerfile b/tools/osbuilder/image-builder/Dockerfile index 535136aa0b..0c5e1a3b11 100644 --- a/tools/osbuilder/image-builder/Dockerfile +++ b/tools/osbuilder/image-builder/Dockerfile @@ -2,8 +2,8 @@ # Copyright (c) 2018 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 - -From registry.fedoraproject.org/fedora:latest +ARG IMAGE_REGISTRY=registry.fedoraproject.org +FROM ${IMAGE_REGISTRY}/fedora:latest RUN [ -n "$http_proxy" ] && sed -i '$ a proxy='$http_proxy /etc/dnf/dnf.conf ; true diff --git a/tools/osbuilder/rootfs-builder/alpine/Dockerfile.in b/tools/osbuilder/rootfs-builder/alpine/Dockerfile.in index 04b9e091c0..2513e9d9b3 100644 --- a/tools/osbuilder/rootfs-builder/alpine/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/alpine/Dockerfile.in @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: Apache-2.0 -From docker.io/alpine:3.11.6 +ARG IMAGE_REGISTRY=docker.io +FROM ${IMAGE_REGISTRY}/alpine:3.11.6 RUN apk update && apk add \ bash \ diff --git a/tools/osbuilder/rootfs-builder/centos/Dockerfile.in b/tools/osbuilder/rootfs-builder/centos/Dockerfile.in index d14068da96..f5b004daf0 100644 --- a/tools/osbuilder/rootfs-builder/centos/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/centos/Dockerfile.in @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: Apache-2.0 -From registry.centos.org/centos:@OS_VERSION@ +ARG IMAGE_REGISTRY=registry.centos.org +FROM ${IMAGE_REGISTRY}/centos:@OS_VERSION@ @SET_PROXY@ diff --git a/tools/osbuilder/rootfs-builder/clearlinux/Dockerfile.in b/tools/osbuilder/rootfs-builder/clearlinux/Dockerfile.in index 173c221072..0146b168c7 100644 --- a/tools/osbuilder/rootfs-builder/clearlinux/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/clearlinux/Dockerfile.in @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: Apache-2.0 -From docker.io/fedora:30 +ARG IMAGE_REGISTRY=docker.io +FROM ${IMAGE_REGISTRY}/fedora:30 @SET_PROXY@ diff --git a/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in b/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in index 13e1532e23..537fc61f15 100644 --- a/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in +++ b/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in @@ -3,8 +3,9 @@ # # SPDX-License-Identifier: Apache-2.0 +ARG IMAGE_REGISTRY=docker.io # NOTE: OS_VERSION is set according to config.sh -from docker.io/debian:@OS_VERSION@ +FROM ${IMAGE_REGISTRY}/debian:@OS_VERSION@ # RUN commands RUN apt-get update && apt-get install -y \ diff --git a/tools/osbuilder/rootfs-builder/debian/Dockerfile.in b/tools/osbuilder/rootfs-builder/debian/Dockerfile.in index 3535f5c4b0..27d7957bd9 100644 --- a/tools/osbuilder/rootfs-builder/debian/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/debian/Dockerfile.in @@ -3,8 +3,9 @@ # # SPDX-License-Identifier: Apache-2.0 +ARG IMAGE_REGISTRY=docker.io # NOTE: OS_VERSION is set according to config.sh -from docker.io/debian:@OS_VERSION@ +FROM ${IMAGE_REGISTRY}/debian:@OS_VERSION@ # RUN commands RUN apt-get update && apt-get --no-install-recommends install -y \ diff --git a/tools/osbuilder/rootfs-builder/fedora/Dockerfile.in b/tools/osbuilder/rootfs-builder/fedora/Dockerfile.in index 55c9ddf355..7b914a901f 100644 --- a/tools/osbuilder/rootfs-builder/fedora/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/fedora/Dockerfile.in @@ -2,8 +2,8 @@ # Copyright (c) 2018 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 - -From registry.fedoraproject.org/fedora:@OS_VERSION@ +ARG IMAGE_REGISTRY=registry.fedoraproject.org +FROM ${IMAGE_REGISTRY}/fedora:@OS_VERSION@ @SET_PROXY@ diff --git a/tools/osbuilder/rootfs-builder/gentoo/Dockerfile.in b/tools/osbuilder/rootfs-builder/gentoo/Dockerfile.in index 5c6e2fdcea..509d89703f 100644 --- a/tools/osbuilder/rootfs-builder/gentoo/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/gentoo/Dockerfile.in @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: Apache-2.0 -from docker.io/gentoo/stage3-amd64:latest +ARG IMAGE_REGISTRY=docker.io +FROM ${IMAGE_REGISTRY}/gentoo/stage3-amd64:latest # This dockerfile needs to provide all the componets need to build a rootfs # Install any package need to create a rootfs (package manager, extra tools) diff --git a/tools/osbuilder/rootfs-builder/suse/Dockerfile.in b/tools/osbuilder/rootfs-builder/suse/Dockerfile.in index 3daa8dfb41..c64fb1fa44 100644 --- a/tools/osbuilder/rootfs-builder/suse/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/suse/Dockerfile.in @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: Apache-2.0 +ARG IMAGE_REGISTRY=docker.io #suse: docker image to be used to create a rootfs #@OS_VERSION@: Docker image version to build this dockerfile -from docker.io/opensuse/leap +FROM ${IMAGE_REGISTRY}/opensuse/leap # This dockerfile needs to provide all the componets need to build a rootfs # Install any package need to create a rootfs (package manager, extra tools) diff --git a/tools/osbuilder/rootfs-builder/template/Dockerfile.template b/tools/osbuilder/rootfs-builder/template/Dockerfile.template index 95a07deec3..d8ff345ab1 100644 --- a/tools/osbuilder/rootfs-builder/template/Dockerfile.template +++ b/tools/osbuilder/rootfs-builder/template/Dockerfile.template @@ -4,8 +4,9 @@ # SPDX-License-Identifier: Apache-2.0 #@distro@: docker image to be used to create a rootfs +ARG IMAGE_REGISTRY=docker.io #@OS_VERSION@: Docker image version to build this dockerfile -from @distro@:@OS_VERSION@ +FROM ${IMAGE_REGISTRY}/@distro@:@OS_VERSION@ # This dockerfile needs to provide all the componets need to build a rootfs # Install any package need to create a rootfs (package manager, extra tools) diff --git a/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile-aarch64.in b/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile-aarch64.in index e20050cd20..9ebbec084f 100644 --- a/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile-aarch64.in +++ b/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile-aarch64.in @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: Apache-2.0 +ARG IMAGE_REGISTRY=docker.io #ubuntu: docker image to be used to create a rootfs #@OS_VERSION@: Docker image version to build this dockerfile -from docker.io/ubuntu:@OS_VERSION@ +FROM ${IMAGE_REGISTRY}/ubuntu:@OS_VERSION@ # This dockerfile needs to provide all the componets need to build a rootfs # Install any package need to create a rootfs (package manager, extra tools) diff --git a/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile.in b/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile.in index 304f53e4d1..13c98dc0d2 100644 --- a/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile.in +++ b/tools/osbuilder/rootfs-builder/ubuntu/Dockerfile.in @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: Apache-2.0 +ARG IMAGE_REGISTRY=docker.io #ubuntu: docker image to be used to create a rootfs #@OS_VERSION@: Docker image version to build this dockerfile -from docker.io/ubuntu:@OS_VERSION@ +FROM ${IMAGE_REGISTRY}/ubuntu:@OS_VERSION@ # This dockerfile needs to provide all the componets need to build a rootfs # Install any package need to create a rootfs (package manager, extra tools)