diff --git a/scripts/build-dockerfile.sh b/scripts/build-dockerfile.sh index 7acda5e..bf82a53 100755 --- a/scripts/build-dockerfile.sh +++ b/scripts/build-dockerfile.sh @@ -34,9 +34,14 @@ The following Dockerfile.solutions were checked, but do not exist: EOF } +REGISTRY_OS_AMR=amr-registry.caas.intel.com/vtt-osgc/os/ +export REGISTRY_OS=${REGISTRY_OS:-${REGISTRY_OS_AMR}} +if [[ "${REGISTRY_OS}" == "external" ]]; then + export REGISTRY_OS= +fi export DOCKERFILE="Dockerfile${SOLUTION_SUFFIX}" export SOLUTION="Dockerfile.solution${SOLUTION_SUFFIX}" -VARS+=(DOCKERFILE SOLUTION BUILD) +VARS+=(DOCKERFILE SOLUTION BUILD REGISTRY_OS) if [[ "${BUILD}" != "" ]] && [[ "${BUILD}" != "N/A" ]]; then # Override PACKAGE_REPOSITORY as it won't be used -- instead a file diff --git a/templates/rhel/00-from.in b/templates/rhel/00-from.in index cd2654b..c35e80d 100644 --- a/templates/rhel/00-from.in +++ b/templates/rhel/00-from.in @@ -1,5 +1,5 @@ # Pull internal RHEL image -FROM amr-registry.caas.intel.com/vtt-osgc/os/rhel:${OS_RELEASE}.0 AS xe-base-stage +FROM ${REGISTRY_OS}rhel:${OS_RELEASE}.0 AS xe-base-stage # Flush cached package lists to prevent stale data RUN dnf clean all diff --git a/templates/sles/08-install-gpg-keys.in b/templates/sles/08-install-gpg-keys.in index 429b6a4..ada80be 100644 --- a/templates/sles/08-install-gpg-keys.in +++ b/templates/sles/08-install-gpg-keys.in @@ -1 +1 @@ -RUN zypper --gpg-auto-import-keys refresh +RUN zypper --non-interactive --gpg-auto-import-keys refresh diff --git a/templates/sles/13-intel-certs.in b/templates/sles/13-intel-certs.in index 658f401..8538e02 100644 --- a/templates/sles/13-intel-certs.in +++ b/templates/sles/13-intel-certs.in @@ -1,6 +1,7 @@ # Install Intel CA5A cert so Intel certs are recognized -RUN zypper -qn install --no-recommends -y unzip wget ca-certificates \ +RUN zypper -qn --non-interactive install --no-recommends -y \ + unzip wget ca-certificates \ && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/IntelSHA2RootChain-Base64.zip \ && unzip -qo tmp.zip -d /etc/pki/trust/anchors \ && rm tmp.zip \ diff --git a/templates/sles/15-suseconnect.in b/templates/sles/15-suseconnect.in index b389a85..e2e2993 100644 --- a/templates/sles/15-suseconnect.in +++ b/templates/sles/15-suseconnect.in @@ -1,3 +1,3 @@ # Add SUSEConnect -RUN zypper install -y SUSEConnect +RUN zypper --non-interactive install -y SUSEConnect diff --git a/templates/sles/15sp1/00-from.in b/templates/sles/15sp1/00-from.in index 2a28480..590bf3e 100644 --- a/templates/sles/15sp1/00-from.in +++ b/templates/sles/15sp1/00-from.in @@ -1,3 +1,3 @@ # Pull internal sles 15sp1 image. -FROM amr-registry.caas.intel.com/vtt-osgc/os/sles:15.1 AS xe-base-stage +FROM ${REGISTRY_OS}sles:15.1 AS xe-base-stage diff --git a/templates/sles/15sp2/00-from.in b/templates/sles/15sp2/00-from.in index 364dcb9..035a6c4 100644 --- a/templates/sles/15sp2/00-from.in +++ b/templates/sles/15sp2/00-from.in @@ -1,3 +1,3 @@ # Pull internal sles 15sp2 image. -FROM amr-registry.caas.intel.com/vtt-osgc/os/sles:15.2 AS xe-base-stage +FROM ${REGISTRY_OS}sles:15.2 AS xe-base-stage diff --git a/templates/sles/18-create-user.in b/templates/sles/18-create-user.in index 0bc0aa8..69705b6 100644 --- a/templates/sles/18-create-user.in +++ b/templates/sles/18-create-user.in @@ -5,7 +5,7 @@ FROM xe-base-stage AS xe-user-stage USER root -RUN zypper install -y sudo +RUN zypper --non-interactive install -y sudo # NOTE: Requires 'sudo' package to already be installed. diff --git a/templates/sles/20-local-file-intel-repo.in b/templates/sles/20-local-file-intel-repo.in index 4486d4d..484d9a9 100755 --- a/templates/sles/20-local-file-intel-repo.in +++ b/templates/sles/20-local-file-intel-repo.in @@ -6,7 +6,7 @@ # Prerequisites # -RUN zypper install -y \ +RUN zypper --non-interactive install -y \ curl \ tar \ createrepo_c \ diff --git a/templates/sles/30-clean-up.in.ignore b/templates/sles/30-clean-up.in.ignore index 924b1d2..d6aa113 100644 --- a/templates/sles/30-clean-up.in.ignore +++ b/templates/sles/30-clean-up.in.ignore @@ -2,6 +2,6 @@ USER root -RUN zypper clean --all +RUN zypper --non-interactive clean --all USER user diff --git a/templates/ubuntu/00-from.in b/templates/ubuntu/00-from.in index 0a12fbc..85ea24f 100644 --- a/templates/ubuntu/00-from.in +++ b/templates/ubuntu/00-from.in @@ -1,3 +1,3 @@ # Pull from $OS_DISTRO on Docker Hub -FROM amr-registry.caas.intel.com/vtt-osgc/os/$OS_DISTRO:$OS_RELEASE AS xe-base-stage +FROM ${REGISTRY_OS}${OS_DISTRO}:${OS_RELEASE} AS xe-base-stage