diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 8cd7a88..5cbdfab 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -6,6 +6,14 @@ on: version: required: true type: string + image_name: + required: false + default: ${{ github.repository }} + type: string + docker_file: + required: false + default: Dockerfile + type: string defaults: run: @@ -13,7 +21,6 @@ defaults: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} jobs: @@ -29,14 +36,15 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ inputs.image_name }} - name: Build Docker image uses: docker/build-push-action@v5 with: context: . + file: ${{ inputs.docker_file }} push: false tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev + ${{ env.REGISTRY }}/${{ inputs.image_name }}:dev labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/create-branch-build.yml b/.github/workflows/create-branch-build.yml index 894aadd..613c688 100644 --- a/.github/workflows/create-branch-build.yml +++ b/.github/workflows/create-branch-build.yml @@ -49,6 +49,15 @@ jobs: with: version: ${{ needs.set-branch-version.outputs.version }} + build-test-package-228: + needs: ['set-branch-version'] + uses: "./.github/workflows/build-test-package.yml" + secrets: inherit + with: + version: ${{ needs.set-branch-version.outputs.version }} + image_name: ${{ github.repository }}-228 + docker_file: "linux-228/Dockerfile" + # This job is here to have only one final step to add for "Status Checks" # in GitHub, instead of adding every leaf test from 'build-test-package' final-check: diff --git a/.github/workflows/create-pr-build.yml b/.github/workflows/create-pr-build.yml index 611202b..7799821 100644 --- a/.github/workflows/create-pr-build.yml +++ b/.github/workflows/create-pr-build.yml @@ -52,6 +52,15 @@ jobs: with: version: ${{ needs.set-pr-version.outputs.version }} + build-test-package-228: + needs: ['set-pr-version'] + uses: "./.github/workflows/build-test-package.yml" + secrets: inherit + with: + version: ${{ needs.set-pr-version.outputs.version }} + image_name: ${{ github.repository }}-228 + docker_file: "linux-228/Dockerfile" + # This job is here to have only one final step to add for "Status Checks" # in GitHub, instead of adding every leaf test from 'build-test-package' final-check: diff --git a/.github/workflows/create-release-build.yml b/.github/workflows/create-release-build.yml index 1e001b6..7069350 100644 --- a/.github/workflows/create-release-build.yml +++ b/.github/workflows/create-release-build.yml @@ -114,3 +114,12 @@ jobs: secrets: inherit with: version: ${{ needs.construct-release-tag.outputs.release-tag }} + + release-228: + needs: ['construct-release-tag'] + uses: "./.github/workflows/release.yml" + secrets: inherit + with: + version: ${{ needs.construct-release-tag.outputs.release-tag }} + image_name: ${{ github.repository }}-228 + docker_file: "linux-228/Dockerfile" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71063da..297c221 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,14 @@ on: version: required: true type: string + image_name: + required: false + default: ${{ github.repository }} + type: string + docker_file: + required: false + default: Dockerfile + type: string defaults: run: @@ -13,7 +21,6 @@ defaults: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} jobs: @@ -29,7 +36,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ inputs.image_name }} - name: Login to container registry uses: docker/login-action@v2 @@ -41,10 +48,11 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v4 with: + file: ${{ inputs.docker_file }} push: true tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.version }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ inputs.image_name }}:${{ inputs.version }} + ${{ env.REGISTRY }}/${{ inputs.image_name }}:latest labels: ${{ steps.meta.outputs.labels }} - name: Create Release diff --git a/README.md b/README.md index 53abb22..9d83bca 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,16 @@ Linux container for building the [Amalgam](https://github.com/howsoai/amalgam) l ## Building +To build the default Amalgam Linux Build Container ```bash docker build -t amalgam-build-container-linux . ``` +To build the Oracle Linux 8.x Container to support GLIBC 2.28 +```bash +docker build -f linux-228/Dockerfile -t amalgam-build-container-linux-228 . +``` + ## License [License](LICENSE.txt) diff --git a/linux-228/Dockerfile b/linux-228/Dockerfile new file mode 100644 index 0000000..970b501 --- /dev/null +++ b/linux-228/Dockerfile @@ -0,0 +1,47 @@ +# The purpose of this dockerfile is to generate a build container +# for Amalgam builds using GLIBC_2_28 so we can support Oracle +# Linx 8.x for an important customer. +FROM oraclelinux:8 + +# Install necessary tools +RUN dnf update -y \ + && dnf install -y \ + sudo gcc gcc-c++ make git wget python3 \ + python3-pip python3-setuptools python3-wheel tzdata clang \ + glibc glibc-locale-source glibc-langpack-en glibc-langpack-es binutils \ + epel-release \ + && dnf install -y \ + gcc-toolset-10-gcc gcc-toolset-10-gcc-c++ \ + && dnf clean all + +# Set Timezone to be America/New_York aka Eastern Timezone. +RUN mkdir -p /zoneinfo && cp -r /usr/share/zoneinfo/* /zoneinfo +ENV TZ=America/New_York +RUN mkdir -p /etc \ + && sudo ln -snf /usr/share/zoneinfo/America/New_York /etc/localtime \ + && echo $TZ > /etc/timezone + +# Set environment for GCC 10 +ENV PATH=/opt/rh/gcc-toolset-10/root/usr/bin:$PATH + +# Install cmake and ninja-build +RUN dnf install -y dnf-plugins-core \ + && dnf --enablerepo=ol8_codeready_builder install cmake ninja-build \ + && dnf clean all + +# Print version info +RUN cmake --version \ + && ninja --version \ + && ldd --version + +# Locale setup for Spanish (no locales package, use langpack instead) +ENV LANG=es_ES.UTF-8 +RUN localedef -i es_ES -f UTF-8 es_ES.UTF-8 + +# Default GCC setup +RUN update-alternatives --install /usr/bin/gcc gcc /opt/rh/gcc-toolset-10/root/usr/bin/gcc 100 \ + --slave /usr/bin/g++ g++ /opt/rh/gcc-toolset-10/root/usr/bin/g++ \ + --slave /usr/bin/gcov gcov /opt/rh/gcc-toolset-10/root/usr/bin/gcov \ + && update-alternatives --set gcc /opt/rh/gcc-toolset-10/root/usr/bin/gcc + +RUN gcc --version && ldd --version