Skip to content

Commit

Permalink
Try switching from CentOS to Almalinux
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Dec 21, 2024
1 parent eb56caf commit c44a63b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Images built:

- `gocddev/gocd-dev-build:dind-<github_tag>`
- `gocddev/gocd-dev-build:centos-9-<github_tag>`
- `gocddev/gocd-dev-build:rhelcompat-9-<github_tag>`
- `gocddev/gocd-dev-build:ubuntu-24-04-<github_tag>`
- `gocddev/gocd-dev-build:windows2025-<github_tag>`

Expand All @@ -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```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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}
}
Expand Down
4 changes: 2 additions & 2 deletions centos.Dockerfile → rhel-compat.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM quay.io/centos/centos:stream9
FROM almalinux:9-minimal
LABEL org.opencontainers.image.authors="GoCD Team <[email protected]>"

ARG BUILDARCH
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", "--"]

Expand Down

0 comments on commit c44a63b

Please sign in to comment.