Skip to content

Commit

Permalink
Merge pull request #17 from 10up/feature/ubuntu2404
Browse files Browse the repository at this point in the history
Feature/ubuntu2404
  • Loading branch information
dustinrue authored Aug 12, 2024
2 parents 9d60ba5 + 3113bde commit 8b673c5
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 42 deletions.
72 changes: 52 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,81 @@ 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
if: ${{ github.ref == 'refs/heads/trunk' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

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

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

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Github Packages
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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: true
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: true
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:
Expand All @@ -63,27 +96,26 @@ jobs:
environment:
name: Build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/trunk' }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

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

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

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push CentOS based Docker images
uses: docker/build-push-action@v2.4.0
uses: docker/build-push-action@v6
with:
push: true
context: centos8
Expand Down
66 changes: 50 additions & 16 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,34 +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@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 @@ -49,18 +83,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

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

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

- name: Build and push CentOS based Docker images
uses: docker/build-push-action@v2.4.0
uses: docker/build-push-action@v6
with:
push: false
context: centos8
Expand Down
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM ubuntu:22.04
ARG UBUNTU_RELEASE_NAME=jammy
FROM ubuntu:${UBUNTU_RELEASE_NAME}

ARG PHP_VERSION=8.2
ARG UBUNTU_RELEASE_NAME=jammy

SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive


RUN \
apt-get update && \
Expand All @@ -13,10 +16,10 @@ RUN \
rm -rf /var/lib/apt/lists/*

RUN \
echo "deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main" | tee /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list && \
echo "deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ ${UBUNTU_RELEASE_NAME} main" | tee /etc/apt/sources.list.d/ondrej-ubuntu-php-${UBUNTU_RELEASE_NAME}.list && \
mkdir ~/.gnupg && chmod 0700 $_ && \
gpg --no-default-keyring --keyring /usr/share/keyrings/ondrej-ubuntu-php.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C && \
sed -i 's/deb /deb \[signed\-by=\/usr\/share\/keyrings\/ondrej-ubuntu-php.gpg\] /' /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list && \
sed -i 's/deb /deb \[signed\-by=\/usr\/share\/keyrings\/ondrej-ubuntu-php.gpg\] /' /etc/apt/sources.list.d/ondrej-ubuntu-php-${UBUNTU_RELEASE_NAME}.list && \
apt-get update && \
rm -rf /var/lib/apt/lists/*

Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Base PHP

This image is the parent for a number of downstream images that make use of PHP either as a commandline tool or for php-fpm. The images are created from a number of base operating systems including CentOS 7, Rocky Linux 8 and Ubuntu. The non-Ubuntu based images are now deprecated and will be replaced with Ubuntu based images over time. This image is meant to be minimal and aims to support the needs of a WordPress ecosystem. The images are offered in both x86_64 and arm64 architectures.
This image is the parent for a number of downstream images that make use of PHP either as a commandline tool or for php-fpm. The images are created from a number of base operating systems including CentOS 7, Rocky Linux 8 and Ubuntu 22.04 and 24.04. The non-Ubuntu based images are now deprecated and will be replaced with Ubuntu based images over time. This image is meant to be minimal and aims to support the needs of a WordPress ecosystem. The images are offered in both x86_64 and arm64 architectures.

## Usage

This image, by itself, is not particularly useful. When run it passes arguments to PHP. This image is used by [10up/wp-php-fpm](https://github.com/10up/wp-php-fpm), [10up/wp-php-fpm-dev](https://github.com/10up/wp-php-fpm-dev) and more. You might use it as the basis for your own image.

## Building

There are currently a number of images being built for the different operating systems. This image is built with support for PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 and 8.2. Note that we do not build CentOS/Rocky Linux based images beyond 8.0 and they will be removed in the future.
There are currently a number of images being built for the different operating systems. This image is built with support for PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 and 8.3. Note that we do not build CentOS/Rocky Linux based images beyond 8.1 and they will be removed in the future.

Also note that CentOS/RL based images are not being pushed to ghcr.io!

Expand All @@ -23,6 +23,7 @@ Images are available under the tags:
* 10up/base-php:7.3 (Deprecated)
* 10up/base-php:7.4 (Deprecated)
* 10up/base-php:8.0 (Deprecated)
* 10up/base-php:8.1 (Deprecated)
* Ubuntu 22.04 based (Docker Hub)
* 10up/base-php:7.0-ubuntu
* 10up/base-php:7.1-ubuntu
Expand All @@ -32,6 +33,7 @@ Images are available under the tags:
* 10up/base-php:8.0-ubuntu
* 10up/base-php:8.1-ubuntu
* 10up/base-php:8.2-ubuntu
* 10up/base-php:8.3-ubuntu
* Ubuntu 22.04 based (Github Packages)
* ghcr.io/10up/base-php:7.0-ubuntu
* ghcr.io/10up/base-php:7.1-ubuntu
Expand All @@ -41,6 +43,27 @@ Images are available under the tags:
* ghcr.io/10up/base-php:8.0-ubuntu
* ghcr.io/10up/base-php:8.1-ubuntu
* ghcr.io/10up/base-php:8.2-ubuntu
* ghcr.io/10up/base-php:8.3-ubuntu
* Ubuntu 24.04 based (Docker Hub)
* 10up/base-php:7.0-noble
* 10up/base-php:7.1-noble
* 10up/base-php:7.2-noble
* 10up/base-php:7.3-noble
* 10up/base-php:7.4-noble
* 10up/base-php:8.0-noble
* 10up/base-php:8.1-noble
* 10up/base-php:8.2-noble
* 10up/base-php:8.3-noble
* Ubuntu 24.04 based (Github Packages)
* ghcr.io/10up/base-php:7.0-noble
* ghcr.io/10up/base-php:7.1-noble
* ghcr.io/10up/base-php:7.2-noble
* ghcr.io/10up/base-php:7.3-noble
* ghcr.io/10up/base-php:7.4-noble
* ghcr.io/10up/base-php:8.0-noble
* ghcr.io/10up/base-php:8.1-noble
* ghcr.io/10up/base-php:8.2-noble
* ghcr.io/10up/base-php:8.3-noble

## Support Level

Expand Down

0 comments on commit 8b673c5

Please sign in to comment.