diff --git a/Makefile b/Makefile index 4e096b8a..7c95254b 100644 --- a/Makefile +++ b/Makefile @@ -68,8 +68,8 @@ endif # make quay.io/centos/centos:stream8 # # It is a shorthand for "make BUILD_IMAGE=mydistro:version build" -.PHONY: docker.io/% quay.io/% -docker.io/% quay.io/%: +.PHONY: docker.io/% quay.io/% registry.access.redhat.com/% +docker.io/% quay.io/% registry.access.redhat.com/%: $(MAKE) BUILD_IMAGE="$@" build .PHONY: checkout @@ -97,6 +97,8 @@ build: @set -x; DOCKER_BUILDKIT=1 docker build \ --pull \ + --build-arg RH_USER=$(RH_USER) \ + --build-arg RH_PASS=$(RH_PASS) \ --platform linux/$(ARCH) \ --build-arg GOLANG_IMAGE="$(GOLANG_IMAGE)" \ --build-arg BUILD_IMAGE="$(BUILD_IMAGE)" \ diff --git a/dockerfiles/rpm.dockerfile b/dockerfiles/rpm.dockerfile index 46d90fc0..75a3154f 100644 --- a/dockerfiles/rpm.dockerfile +++ b/dockerfiles/rpm.dockerfile @@ -34,6 +34,11 @@ FROM ${BUILD_IMAGE} AS redhat-base RUN yum install -y yum-utils rpm-build git FROM redhat-base AS rhel-base +ARG RH_USER +ARG RH_PASS +RUN rm /etc/rhsm-host +RUN subscription-manager register --username=$RH_USER --password=$RH_PASS +RUN subscription-manager repos --enable codeready-builder-for-rhel-$(source /etc/os-release && echo "${VERSION_ID%.*}")-$(arch)-rpms FROM redhat-base AS centos-base # Using a wildcard: CentOS 7 uses "CentOS-RepoName", CentOS 8 uses "CentOS-Linux-RepoName"