From 2874fc72220066bd3900b66162278350acd62226 Mon Sep 17 00:00:00 2001 From: Ferris <3579192+code-ape@users.noreply.github.com> Date: Mon, 3 Mar 2025 15:34:25 -0500 Subject: [PATCH] Adding rockylinux9-builder --- .github/workflows/cd-rockylinux9-builder.yaml | 42 +++++++++++++++++++ .github/workflows/ci-rockylinux9-builder.yaml | 42 +++++++++++++++++++ README.md | 1 + rockylinux9-builder/Dockerfile | 10 +++++ rockylinux9-builder/README.md | 26 ++++++++++++ 5 files changed, 121 insertions(+) create mode 100644 .github/workflows/cd-rockylinux9-builder.yaml create mode 100644 .github/workflows/ci-rockylinux9-builder.yaml create mode 100644 rockylinux9-builder/Dockerfile create mode 100644 rockylinux9-builder/README.md diff --git a/.github/workflows/cd-rockylinux9-builder.yaml b/.github/workflows/cd-rockylinux9-builder.yaml new file mode 100644 index 0000000..24e31f0 --- /dev/null +++ b/.github/workflows/cd-rockylinux9-builder.yaml @@ -0,0 +1,42 @@ +name: CD for rockylinux9-builder + +on: + push: + branches: ['main'] + paths: ['rockylinux9-builder/**', '!**/*.md'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: urbdyn/rockylinux9-builder + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: ./rockylinux9-builder + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/ci-rockylinux9-builder.yaml b/.github/workflows/ci-rockylinux9-builder.yaml new file mode 100644 index 0000000..739bafc --- /dev/null +++ b/.github/workflows/ci-rockylinux9-builder.yaml @@ -0,0 +1,42 @@ +name: CI for rockylinux9-builder + +on: + pull_request: + branches: ['main'] + paths: ['rockylinux9-builder/**', '!**/*.md'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: urbdyn/rockylinux9-builder + +jobs: + build-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build Docker image + uses: docker/build-push-action@v4 + with: + context: ./rockylinux9-builder + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index 287051f..b7e4cb6 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,4 @@ This repo is a collection of utilities for building software as used by Urban Dy 1. [centos7-devtoolset8-builder](./centos7-devtoolset8-builder/) 2. [centos7-rpm-builder](./centos7-rpm-builder/) 3. [rockylinux8-rpm-builder](./rockylinux8-rpm-builder/) +4. [rockylinux9-builder](./rockylinux9-builder/) diff --git a/rockylinux9-builder/Dockerfile b/rockylinux9-builder/Dockerfile new file mode 100644 index 0000000..f529586 --- /dev/null +++ b/rockylinux9-builder/Dockerfile @@ -0,0 +1,10 @@ +# This file builds an build image for Rocky Linux 9 + +# Using Rocky Linux 9.5 as base image (pulled on date 2025-03-03). +FROM docker.io/rockylinux/rockylinux@sha256:149fd31d916038eb1084d0e051537e279d7afcd5de0b365254e8fa3c3ef12bad + +# Installing tools needed for builds +RUN dnf install -y which python3 epel-release && \ + dnf groupinstall -y "Development Tools" && \ + dnf install -y ccache && \ + dnf clean all diff --git a/rockylinux9-builder/README.md b/rockylinux9-builder/README.md new file mode 100644 index 0000000..db77406 --- /dev/null +++ b/rockylinux9-builder/README.md @@ -0,0 +1,26 @@ +# urbdyn/rockylinux9-builder + +This is a Docker container for building binaries on Rocky Linux 9 using the standard `"Development Tools"` group install. + +It has the benefit of providing all the needed boiler plate and avoiding the long waits in CI needed to install the full build `"Development Tools"` toolchain in a clean container. + +Our recommended use of it is to build your own container with it to ensure you have any other dependencies you need. +To use to build something follow the below sections: + +## Creating container with this container + +```Dockerfile +FROM urbdyn/rockylinux9-builder:latest + +# Install any needed packages here +# ... +``` + +## Running container + +```bash +docker create -it \ + --name "$container_builder_container" \ + -v "$build_dir/:/TARGET_BUILD_DIR_HERE/" \ + "$container_builder_image" +```