From 93918d6f9ddc88a231819a4da3b8b13e5c22e033 Mon Sep 17 00:00:00 2001 From: "dave@tiredofit.ca" Date: Fri, 28 Jul 2023 13:00:55 -0700 Subject: [PATCH] Release 7.6.12 - See CHANGELOG.md --- .github/workflows/main.yml | 634 ++++++++++++++++++++++++++++++++++- .github/workflows/manual.yml | 634 ++++++++++++++++++++++++++++++++++- CHANGELOG.md | 9 + Dockerfile.debian | 2 + README.md | 10 +- install/usr/sbin/php-ext | 2 +- 6 files changed, 1271 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0a80e7..0625b74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1131,6 +1131,129 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php82_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.2 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md php82_debian_bullseye: env: DISTRO: "debian" @@ -1379,6 +1502,131 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php81_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.1 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### php81_debian_bullseye: env: DISTRO: "debian" @@ -1628,10 +1876,10 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### - php80_debian_bullseye: + php80_debian_bookworm: env: DISTRO: "debian" - DISTRO_VARIANT: "bullseye" + DISTRO_VARIANT: "bookworm" PHP_BASE: "8.0" build_file: Dockerfile.debian runs-on: ubuntu-latest @@ -1752,10 +2000,10 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### - php80_debian_buster: + php80_debian_bullseye: env: DISTRO: "debian" - DISTRO_VARIANT: "buster" + DISTRO_VARIANT: "bullseye" PHP_BASE: "8.0" build_file: Dockerfile.debian runs-on: ubuntu-latest @@ -1876,11 +2124,259 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### - php74_debian_bullseye: + php80_debian_buster: env: DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: 7.4 + DISTRO_VARIANT: "buster" + PHP_BASE: "8.0" + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 7.4 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: 7.4 build_file: Dockerfile.debian runs-on: ubuntu-latest steps: @@ -2124,6 +2620,130 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php73_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 7.3 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### php73_debian_bullseye: env: DISTRO: "debian" diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 55ef2ce..035f2e2 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -1130,6 +1130,129 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php82_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.2 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md php82_debian_bullseye: env: DISTRO: "debian" @@ -1378,6 +1501,131 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php81_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.1 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### php81_debian_bullseye: env: DISTRO: "debian" @@ -1627,10 +1875,10 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### - php80_debian_bullseye: + php80_debian_bookworm: env: DISTRO: "debian" - DISTRO_VARIANT: "bullseye" + DISTRO_VARIANT: "bookworm" PHP_BASE: "8.0" build_file: Dockerfile.debian runs-on: ubuntu-latest @@ -1751,10 +1999,10 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### - php80_debian_buster: + php80_debian_bullseye: env: DISTRO: "debian" - DISTRO_VARIANT: "buster" + DISTRO_VARIANT: "bullseye" PHP_BASE: "8.0" build_file: Dockerfile.debian runs-on: ubuntu-latest @@ -1875,11 +2123,259 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### - php74_debian_bullseye: + php80_debian_buster: env: DISTRO: "debian" - DISTRO_VARIANT: "bullseye" - PHP_BASE: 7.4 + DISTRO_VARIANT: "buster" + PHP_BASE: "8.0" + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 7.4 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### + php74_debian_bullseye: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bullseye" + PHP_BASE: 7.4 build_file: Dockerfile.debian runs-on: ubuntu-latest steps: @@ -2123,6 +2619,130 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php73_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 7.3 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ env.LATEST }}" = "TRUE" ] || [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${DISTRO_VARIANT}" = "${{ secrets.LATEST_DEBIAN }}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v4 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +### php73_debian_bullseye: env: DISTRO: "debian" diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c3309..a76ac78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 7.6.12 2023-07-28 + + ### Added + - Add support for Debian Bookworm + + ### Changed + - Cleanup some PHP directories that shouldn't exist on Debian variants + + ## 7.6.11 2023-07-25 ### Changed diff --git a/Dockerfile.debian b/Dockerfile.debian index 5c7f3a5..14968bc 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -181,6 +181,8 @@ RUN export PHP_7_3_RUN_DEPS=" \ \ package cleanup && \ mkdir -p /var/log/nginx && \ + shopt -s extglob && \ + rm -rf /etc/php/!(${PHP_BASE}) rm -rf \ /root/.gnupg \ /tmp/* \ diff --git a/README.md b/README.md index 08c7787..6eb19e3 100644 --- a/README.md +++ b/README.md @@ -87,11 +87,11 @@ The following image tags are available along with their tagged release based on | PHP version | Alpine Base | Tag | Debian Base | Tag | | ----------- | ----------- | -------------- | ----------- | ------------- | | latest | edge | `:alpine-edge` | | | -| 8.2.x | edge | `:alpine-8.2` | Bullseye | `:debian-8.2` | -| 8.1.x | 3.17 | `:alpine-8.1` | Buster | `:debian-8.1` | -| 8.0.x | 3.16 | `:alpine-8.0` | Buster | `:debian-8.0` | -| 7.4.x | 3.15 | `:alpine-7.4` | Buster | `:debian-7.3` | -| 7.3.x | 3.12 | `:alpine-7.3` | Buster | `:debian-7.3` | +| 8.2.x | edge | `:alpine-8.2` | Bookworm | `:debian-8.2` | +| 8.1.x | 3.17 | `:alpine-8.1` | Bookworm | `:debian-8.1` | +| 8.0.x | 3.16 | `:alpine-8.0` | Bookworm | `:debian-8.0` | +| 7.4.x | 3.15 | `:alpine-7.4` | Bookworm | `:debian-7.4` | +| 7.3.x | 3.12 | `:alpine-7.3` | Bookworm | `:debian-7.3` | | 7.2.x | 3.9 | `:alpine-7.2` | | | | 7.1.x | 3.7 | `:alpine-7.1` | | | | 7.0.x | 3.5 | `:alpine-7.0` | | | diff --git a/install/usr/sbin/php-ext b/install/usr/sbin/php-ext index 796db6b..3d4a477 100755 --- a/install/usr/sbin/php-ext +++ b/install/usr/sbin/php-ext @@ -27,7 +27,7 @@ case ${os} in ;; esac -if [ "${PHP_ENABLE_OPENSSL,,}" = "true" ] && [ ! -f "${php_prefix}/mods-available/openssl.ini" ]; then +if [ "${PHP_ENABLE_OPENSSL,,}" = "true" ] && [ ! -f "${php_prefix}"/mods-available/openssl.ini ]; then export PHP_ENABLE_OPENSSL=FALSE fi