diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d7f810d..7aa28b0 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -45,7 +45,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} pull: true - centos-build: + rhel-compat-build: runs-on: ${{ matrix.runner }} strategy: fail-fast: false @@ -66,7 +66,7 @@ jobs: images: ${{ env.REGISTRY_IMAGE }} flavor: | latest=false - prefix=centos-9- + prefix=rhelcompat-9- - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -82,7 +82,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: centos.Dockerfile + file: rhel-compat.Dockerfile labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true pull: true @@ -101,10 +101,10 @@ jobs: if-no-files-found: error retention-days: 1 - centos-push: + rhel-compat-push: runs-on: ubuntu-latest needs: - - centos-build + - rhel-compat-build steps: - name: Download x64 digest uses: actions/download-artifact@v4 @@ -127,7 +127,7 @@ jobs: images: ${{ env.REGISTRY_IMAGE }} flavor: | latest=false - prefix=centos-9- + prefix=rhelcompat-9- - name: Login to Docker Hub uses: docker/login-action@v3 diff --git a/README.md b/README.md index 2905927..cdc818b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Images built: - `gocddev/gocd-dev-build:dind-` -- `gocddev/gocd-dev-build:centos-9-` +- `gocddev/gocd-dev-build:rhelcompat-9-` - `gocddev/gocd-dev-build:ubuntu-24-04-` - `gocddev/gocd-dev-build:windows2025-` @@ -10,7 +10,7 @@ To build a new version of the images, push a new version tag to this repository. # Build an image locally - ```docker build . --pull -t gocddev/gocd-dev-build:dind-SNAPSHOT -f dind.Dockerfile``` -- ```docker build . --pull -t gocddev/gocd-dev-build:centos-9-SNAPSHOT -f centos.Dockerfile``` +- ```docker build . --pull -t gocddev/gocd-dev-build:rhelcompat-9-SNAPSHOT -f rhel-compat.Dockerfile``` - ```docker build . --pull -t gocddev/gocd-dev-build:ubuntu-24-04-SNAPSHOT -f ubuntu.Dockerfile``` - ```docker build . --pull -t gocddev/gocd-dev-build:windows2025-SNAPSHOT -f windowsservercore.Dockerfile``` diff --git a/provision/provision-centos.sh b/provision/provision-rhel-compat.sh similarity index 96% rename from provision/provision-centos.sh rename to provision/provision-rhel-compat.sh index 29f2727..dde9cbc 100755 --- a/provision/provision-centos.sh +++ b/provision/provision-rhel-compat.sh @@ -22,7 +22,7 @@ ANT_VERSION=1.10.15 # https://ant.apache.org/bindownload.cgi P4_VERSION=24.1 # https://cdist2.perforce.com/perforce/ P4D_VERSION=24.1 -CENTOS_MAJOR_VERSION=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f4 | cut -d"." -f1) +RHEL_COMPAT_MAJOR_VERSION=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos|alma|rocky" | cut -d"-" -f4 | cut -d"." -f1) # import functions source "$(dirname $0)/provision-common.sh" @@ -92,7 +92,7 @@ function provision() { } function setup_epel() { - try dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${CENTOS_MAJOR_VERSION}.noarch.rpm + try dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL_COMPAT_MAJOR_VERSION}.noarch.rpm } function setup_external_repos() { @@ -169,7 +169,7 @@ function install_awscli_mimetypes() { } function setup_postgres_repo() { - try dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$CENTOS_MAJOR_VERSION-$(arch)/pgdg-redhat-repo-latest.noarch.rpm + try dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$RHEL_COMPAT_MAJOR_VERSION-$(arch)/pgdg-redhat-repo-latest.noarch.rpm } function install_postgresql() { @@ -243,7 +243,7 @@ function build_gocd() { } function install_docker() { - try dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo + try dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo try dnf -y install docker-ce containerd.io docker-buildx-plugin try usermod -a -G docker ${PRIMARY_USER} } diff --git a/centos.Dockerfile b/rhel-compat.Dockerfile similarity index 79% rename from centos.Dockerfile rename to rhel-compat.Dockerfile index b3580d7..90f6c90 100644 --- a/centos.Dockerfile +++ b/rhel-compat.Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/centos/centos:stream9 +FROM almalinux:9-minimal LABEL org.opencontainers.image.authors="GoCD Team " ARG BUILDARCH @@ -6,7 +6,7 @@ ARG TARGETARCH COPY provision /usr/local/src/provision/ -RUN /usr/local/src/provision/provision-centos.sh +RUN /usr/local/src/provision/provision-rhel-compat.sh ENTRYPOINT ["/usr/bin/tini", "--"]