Skip to content

Commit

Permalink
initial steps to introduce ubuntu 24.04 (noble) images
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinrue committed Aug 3, 2024
1 parent f542a15 commit 327eb11
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 deletions.
63 changes: 46 additions & 17 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Images
name: Build Images (Testing)

on:
push:
Expand All @@ -10,39 +10,68 @@ jobs:
strategy:
matrix:
version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
ubuntu-release-name: ['jammy', 'noble']
environment:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
- name: Extract metadata (tags, labels) for Docker (Jammy)
if: matrix.ubuntu-release-name == 'jammy'
id: meta-jammy
uses: docker/metadata-action@v5
with:
tags: |
type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu
type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }}
type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu
images: |
${{ secrets.IMAGE_NAME }}
ghcr.io/${{ github.repository }}
- name: Build and push Docker images
uses: docker/build-push-action@v4
- name: Extract metadata (tags, labels) for Docker (Others)
if: matrix.ubuntu-release-name != 'jammy'
id: meta-others
uses: docker/metadata-action@v5
with:
tags: |
type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }}
images: |
${{ secrets.IMAGE_NAME }}
ghcr.io/${{ github.repository }}
- name: Build and push Docker images (Jammy)
if: matrix.ubuntu-release-name == 'jammy'
uses: docker/build-push-action@v6
with:
push: false
platforms: linux/amd64,linux/arm64
build-args: PHP_VERSION=${{ matrix.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PHP_VERSION=${{ matrix.version }}
UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }}
tags: ${{ steps.meta-jammy.outputs.tags }}
labels: ${{ steps.meta-jammy.outputs.labels }}

- name: Build and push Docker images (Others)
if: matrix.ubuntu-release-name != 'jammy'
uses: docker/build-push-action@v6
with:
push: false
platforms: linux/amd64,linux/arm64
build-args: |
PHP_VERSION=${{ matrix.version }}
UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }}
tags: ${{ steps.meta-others.outputs.tags }}
labels: ${{ steps.meta-others.outputs.labels }}


Build_PHP_CentOS8_Test:
Expand All @@ -54,18 +83,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build and push CentOS based Docker images
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: false
context: centos8
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ ARG PHP_VERSION=8.2

# Set a BASE_IMAGE CI var to specify a different base image without a tag
ARG BASE_IMAGE=ghcr.io/10up/base-php
FROM ${BASE_IMAGE}:${PHP_VERSION}-ubuntu
ARG UBUNTU_RELEASE_NAME=jammy
FROM ${BASE_IMAGE}:${PHP_VERSION}-${UBUNTU_RELEASE_NAME}

ARG PHP_VERSION=8.2
ARG TARGETPLATFORM
Expand Down Expand Up @@ -34,7 +35,7 @@ RUN \
# You must set DD_AGENT_HOST and DD_TRACE_AGENT_PORT to point at your DD Agent
# We also clean up whatever this config file layout is
RUN \
curl -LO https://github.com/DataDog/dd-trace-php/releases/download/0.94.0/datadog-setup.php -o /tmp/datadog-setup.php && \
curl -LO https://github.com/DataDog/dd-trace-php/releases/download/1.2.0/datadog-setup.php -o /tmp/datadog-setup.php && \
if [[ ${PHP_VERSION} = "5.6" ]] || [[ ${PHP_VERSION} = "7.0" ]]; then php datadog-setup.php --php-bin=all; else php datadog-setup.php --php-bin=all; fi && \
rm -f /tmp/datadog-setup.php && \
mv /etc/php/${PHP_VERSION}/cli/conf.d/98-ddtrace.ini /etc/php/${PHP_VERSION}/mods-available/ddtrace.ini && \
Expand Down

0 comments on commit 327eb11

Please sign in to comment.