From 5b2d5216725fc732c76712aff9db9bc80175fcce Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Sat, 21 Nov 2026 06:32:01 +0000 Subject: [PATCH] [!!!][TASK] Stop building bootstrap, base, base-app and dockerfile-build-env, and run the CI on the runners webdevops/dockerfile-build-env was base-app:ubuntu-22.04 with Docker, git and make, the container in which every image job of the CI ran. The GitHub runners for amd64 and arm64 have Docker, Buildx, git and make themselves, and the jobs that run on them already (validation, checks of ci/, image test runner) show that; the image jobs now run there too and no longer pull the build environment first. dockerfile-build-env was the only image here that built on bootstrap, base and base-app; the PHP images build on the official PHP images and bring the same layers themselves. So these four images are no longer built. Their last images stay on Docker Hub without updates; conf/dockerhub.yml lists them as discontinued, with webdevops/php or an official image plus the helper scripts of webdevops/toolbox as replacement. What the PHP images still use stays: provisioning/base and base-app, the templates of the layers (without their Ubuntu macros) and the traits of the image tests. The tests of docker-service and dnsmasq, which only BaseTest used, now run in PhpTest. conf/console.yml sets no tag as latest any more (autoLatestTag: ~). --- .github/workflows/build.yaml | 733 +----------------- AGENTS.md | 4 +- CONTRIBUTING.md | 6 +- .../Checks/AdditionalServicesChecks.php | 13 +- ci/image-tests/Checks/BaseAppChecks.php | 3 +- ci/image-tests/Checks/BaseChecks.php | 7 +- ci/image-tests/Checks/BootstrapChecks.php | 10 +- ci/image-tests/Checks/BuildEnvChecks.php | 40 - .../CliWithoutApplicationUserChecks.php | 25 - ci/image-tests/Checks/HealthcheckChecks.php | 2 +- ci/image-tests/Checks/ServiceChecks.php | 8 +- ci/image-tests/Docker/Container.php | 6 +- ci/image-tests/ImageUnderTest.php | 4 +- ci/image-tests/Images/BaseAppTest.php | 26 - ci/image-tests/Images/BaseTest.php | 32 - ci/image-tests/Images/BootstrapTest.php | 16 - .../Images/DockerfileBuildEnvTest.php | 20 - ci/image-tests/Images/PhpTest.php | 4 + ci/src/FileReader.php | 20 +- ci/src/GithubJobBuilder.php | 14 +- ci/tests/FileReaderTest.php | 17 +- ci/tests/GithubJobBuilderTest.php | 2 +- ci/tests/ImageTestsTest.php | 2 +- conf/console.yml | 5 +- conf/dockerhub.yml | 71 +- conf/provision.yml | 6 - docker/base-app/ubuntu-22.04/Dockerfile | 32 - docker/base-app/ubuntu-22.04/Dockerfile.twig | 14 - .../bootstrap.d/10-user-application.sh | 10 - .../conf/provision/bootstrap.d/20-app.sh | 5 - docker/base/ubuntu-22.04/Dockerfile | 29 - docker/base/ubuntu-22.04/Dockerfile.twig | 17 - docker/base/ubuntu-22.04/conf/VERSION | 1 - .../base/ubuntu-22.04/conf/bin/bootstrap.sh | 3 - docker/base/ubuntu-22.04/conf/bin/config.sh | 117 --- docker/base/ubuntu-22.04/conf/bin/control.sh | 78 -- .../ubuntu-22.04/conf/bin/entrypoint.d/cli.sh | 22 - .../conf/bin/entrypoint.d/default.sh | 3 - .../conf/bin/entrypoint.d/noop.sh | 7 - .../conf/bin/entrypoint.d/root.sh | 14 - .../conf/bin/entrypoint.d/supervisord.sh | 9 - .../base/ubuntu-22.04/conf/bin/entrypoint.sh | 46 -- .../conf/bin/service.d/cron.d/10-init.sh | 16 - .../ubuntu-22.04/conf/bin/service.d/cron.sh | 10 - .../conf/bin/service.d/dnsmasq.d/10-init.sh | 37 - .../conf/bin/service.d/dnsmasq.sh | 11 - .../conf/bin/service.d/postfix.d/10-init.sh | 32 - .../conf/bin/service.d/postfix.sh | 32 - .../conf/bin/service.d/ssh.d/10-init.sh | 7 - .../ubuntu-22.04/conf/bin/service.d/ssh.sh | 10 - .../bin/service.d/supervisor.d/10-init.sh | 1 - .../conf/bin/service.d/supervisor.sh | 11 - .../conf/bin/service.d/syslog-ng.d/10-init.sh | 10 - .../conf/bin/service.d/syslog-ng.sh | 10 - .../bin/usr-bin/container-file-auto-restore | 26 - .../conf/bin/usr-bin/docker-cronjob | 48 -- .../conf/bin/usr-bin/docker-healthcheck | 50 -- .../conf/bin/usr-bin/docker-service | 89 --- .../conf/bin/usr-bin/docker-service-disable | 3 - .../conf/bin/usr-bin/docker-service-enable | 4 - .../ubuntu-22.04/conf/bin/usr-bin/service | 86 -- .../conf/bin/usr-bin/version-compare | 43 - .../base/ubuntu-22.04/conf/etc/cron/.gitkeep | 0 .../conf/etc/logrotate.d/syslog-ng | 38 - .../ubuntu-22.04/conf/etc/supervisor.conf | 20 - .../conf/etc/supervisor.d/.gitkeep | 0 .../conf/etc/supervisor.d/cron.conf | 14 - .../conf/etc/supervisor.d/dnsmasq.conf | 14 - .../conf/etc/supervisor.d/postfix.conf | 17 - .../conf/etc/supervisor.d/ssh.conf | 14 - .../conf/etc/supervisor.d/syslog.conf | 13 - .../conf/etc/syslog-ng/syslog-ng.conf | 49 -- .../conf/provision/bootstrap.d/.gitkeep | 0 .../provision/bootstrap.d/10-entrypoint.sh | 14 - .../provision/bootstrap.d/10-permissions.sh | 2 - .../provision/bootstrap.d/10-supervisor.sh | 10 - .../conf/provision/bootstrap.d/90-cleanup.sh | 12 - .../conf/provision/build.d/.gitkeep | 0 .../conf/provision/build.d/10-cleanup.sh | 7 - .../conf/provision/entrypoint.d/.gitkeep | 0 .../provision/entrypoint.d/05-permissions.sh | 2 - .../conf/provision/service.d/.gitkeep | 0 .../conf/provision/service.d/cron.sh | 9 - .../conf/provision/service.d/dnsmasq.sh | 20 - .../conf/provision/service.d/postfix.sh | 23 - .../conf/provision/service.d/ssh.sh | 13 - .../conf/provision/service.d/syslog.sh | 34 - docker/bootstrap/ubuntu-22.04/Dockerfile | 37 - docker/bootstrap/ubuntu-22.04/Dockerfile.twig | 18 - docker/dockerfile-build-env/latest/Dockerfile | 24 - .../latest/Dockerfile.twig | 20 - docs/README.md | 13 +- docs/customization.md | 30 +- docs/discontinued-images.md | 32 +- docs/dockerhub/base-app.md | 32 +- docs/dockerhub/base.md | 32 +- docs/dockerhub/bootstrap.md | 31 +- docs/dockerhub/dockerfile-build-env.md | 19 +- docs/dockerhub/toolbox.md | 2 +- docs/environment-variables.md | 10 +- docs/images/base.md | 33 - docs/known-issues.md | 3 +- template/Dockerfile/images/base.twig | 13 - template/Dockerfile/images/baseapp.twig | 17 - template/Dockerfile/images/bootstrap.twig | 14 - 105 files changed, 165 insertions(+), 2579 deletions(-) delete mode 100644 ci/image-tests/Checks/BuildEnvChecks.php delete mode 100644 ci/image-tests/Checks/CliWithoutApplicationUserChecks.php delete mode 100644 ci/image-tests/Images/BaseAppTest.php delete mode 100644 ci/image-tests/Images/BaseTest.php delete mode 100644 ci/image-tests/Images/BootstrapTest.php delete mode 100644 ci/image-tests/Images/DockerfileBuildEnvTest.php delete mode 100644 docker/base-app/ubuntu-22.04/Dockerfile delete mode 100644 docker/base-app/ubuntu-22.04/Dockerfile.twig delete mode 100644 docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/10-user-application.sh delete mode 100644 docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/20-app.sh delete mode 100644 docker/base/ubuntu-22.04/Dockerfile delete mode 100644 docker/base/ubuntu-22.04/Dockerfile.twig delete mode 100644 docker/base/ubuntu-22.04/conf/VERSION delete mode 100644 docker/base/ubuntu-22.04/conf/bin/bootstrap.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/config.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/control.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/entrypoint.d/cli.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/entrypoint.d/default.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/entrypoint.d/noop.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/entrypoint.d/root.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/entrypoint.d/supervisord.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/entrypoint.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/cron.d/10-init.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/cron.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.d/10-init.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/postfix.d/10-init.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/postfix.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/ssh.d/10-init.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/ssh.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.d/10-init.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.d/10-init.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.sh delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/container-file-auto-restore delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-cronjob delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-healthcheck delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-disable delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-enable delete mode 100755 docker/base/ubuntu-22.04/conf/bin/usr-bin/service delete mode 100644 docker/base/ubuntu-22.04/conf/bin/usr-bin/version-compare delete mode 100644 docker/base/ubuntu-22.04/conf/etc/cron/.gitkeep delete mode 100644 docker/base/ubuntu-22.04/conf/etc/logrotate.d/syslog-ng delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.conf delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.d/.gitkeep delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.d/cron.conf delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.d/dnsmasq.conf delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.d/postfix.conf delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.d/ssh.conf delete mode 100644 docker/base/ubuntu-22.04/conf/etc/supervisor.d/syslog.conf delete mode 100644 docker/base/ubuntu-22.04/conf/etc/syslog-ng/syslog-ng.conf delete mode 100644 docker/base/ubuntu-22.04/conf/provision/bootstrap.d/.gitkeep delete mode 100644 docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-entrypoint.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-permissions.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-supervisor.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/bootstrap.d/90-cleanup.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/build.d/.gitkeep delete mode 100644 docker/base/ubuntu-22.04/conf/provision/build.d/10-cleanup.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/entrypoint.d/.gitkeep delete mode 100644 docker/base/ubuntu-22.04/conf/provision/entrypoint.d/05-permissions.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/service.d/.gitkeep delete mode 100644 docker/base/ubuntu-22.04/conf/provision/service.d/cron.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/service.d/dnsmasq.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/service.d/postfix.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/service.d/ssh.sh delete mode 100644 docker/base/ubuntu-22.04/conf/provision/service.d/syslog.sh delete mode 100644 docker/bootstrap/ubuntu-22.04/Dockerfile delete mode 100644 docker/bootstrap/ubuntu-22.04/Dockerfile.twig delete mode 100644 docker/dockerfile-build-env/latest/Dockerfile delete mode 100644 docker/dockerfile-build-env/latest/Dockerfile.twig delete mode 100644 docs/images/base.md diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0c51c61bf..d905d9180 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -116,7 +116,7 @@ jobs: env: REPOSITORY: webdevops/base PAGE: docs/dockerhub/base.md - SHORT_DESCRIPTION: 'Ubuntu 22.04 with entrypoint, supervisord, service scripts and hooks, a base for your own images' + SHORT_DESCRIPTION: 'No longer built or updated. Use webdevops/php:8.5 instead.' run: |- jq -n --rawfile full_description "$PAGE" --arg description "$SHORT_DESCRIPTION" \ '{full_description: $full_description, description: $description}' \ @@ -130,7 +130,7 @@ jobs: env: REPOSITORY: webdevops/base-app PAGE: docs/dockerhub/base-app.md - SHORT_DESCRIPTION: 'webdevops/base with the user application, /app and tools such as git, rsync and the SSH client' + SHORT_DESCRIPTION: 'No longer built or updated. Use webdevops/php:8.5 instead.' run: |- jq -n --rawfile full_description "$PAGE" --arg description "$SHORT_DESCRIPTION" \ '{full_description: $full_description, description: $description}' \ @@ -144,7 +144,7 @@ jobs: env: REPOSITORY: webdevops/bootstrap PAGE: docs/dockerhub/bootstrap.md - SHORT_DESCRIPTION: 'Ubuntu 22.04 with the webdevops helper scripts, a base for your own images' + SHORT_DESCRIPTION: 'No longer built or updated. Use ubuntu:22.04 instead.' run: |- jq -n --rawfile full_description "$PAGE" --arg description "$SHORT_DESCRIPTION" \ '{full_description: $full_description, description: $description}' \ @@ -172,7 +172,7 @@ jobs: env: REPOSITORY: webdevops/dockerfile-build-env PAGE: docs/dockerhub/dockerfile-build-env.md - SHORT_DESCRIPTION: 'Build environment of github.com/webdevops/Dockerfile, in which its CI builds the images' + SHORT_DESCRIPTION: 'No longer built or updated.' run: |- jq -n --rawfile full_description "$PAGE" --arg description "$SHORT_DESCRIPTION" \ '{full_description: $full_description, description: $description}' \ @@ -590,670 +590,6 @@ jobs: overwrite: true compression-level: 0 if-no-files-found: error - base-app_ubuntu-22-04: - strategy: - fail-fast: false - matrix: - include: - - - arch: amd64 - runner: ubuntu-24.04 - platform: linux/amd64 - - - arch: arm64 - runner: ubuntu-24.04-arm - platform: linux/arm64 - name: 'webdevops/base-app:ubuntu-22.04 (${{ matrix.arch }})' - needs: - - base_ubuntu-22-04_publish - - image-test-runner - if: '${{ !failure() && !cancelled() }}' - runs-on: '${{ matrix.runner }}' - permissions: - contents: read - packages: write - container: webdevops/dockerfile-build-env - steps: - - - uses: actions/checkout@v7 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v4 - - - name: 'Download parent image (OCI layout): webdevops/base:ubuntu-22.04' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/download-artifact@v8 - with: - name: 'docker-parent-base_ubuntu-22-04-${{ matrix.arch }}' - path: .ci-oci-image/base_ubuntu-22-04 - - - name: 'Build (load locally)' - if: "${{ github.ref == 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/base-app/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/base-app:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/base-app:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/base-app:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - - - name: 'Build (load locally, from parent artifact)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/base-app/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/base-app:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/base-app:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/base-app:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/base:ubuntu-22.04=oci-layout://.ci-oci-image/base_ubuntu-22-04:ci-parent-image' - - - name: 'Download the image test runner' - id: download-image-test-runner - uses: actions/download-artifact@v8 - continue-on-error: true - with: - name: 'webdevops-image-tests-${{ matrix.arch }}' - path: .ci-image-test-runner - - - name: 'Load the image test runner' - id: load-image-test-runner - if: "${{ steps.download-image-test-runner.outcome == 'success' }}" - continue-on-error: true - run: 'docker load --input .ci-image-test-runner/webdevops-image-tests.tar && rm .ci-image-test-runner/webdevops-image-tests.tar' - - - name: 'Build the image test runner' - if: "${{ steps.load-image-test-runner.outcome != 'success' }}" - uses: docker/build-push-action@v7 - with: - context: . - file: ci/image-tests/Dockerfile - load: true - tags: webdevops-image-tests - cache-from: 'type=gha,scope=webdevops-image-tests-${{ matrix.arch }}' - - - name: 'run image tests' - run: 'make test-image-run IMAGE=webdevops/base-app:ubuntu-22.04 REFERENCE=ghcr.io/webdevops/base-app:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - - - if: "${{github.ref == 'refs/heads/master'}}" - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Push arch image' - if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/base-app:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04"' - - - name: 'Export image (OCI layout)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/base-app/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - cache-from: 'type=gha,scope=webdevops/base-app:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/base-app:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/base:ubuntu-22.04=oci-layout://.ci-oci-image/base_ubuntu-22-04:ci-parent-image' - outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/base-app_ubuntu-22-04' - - - name: 'Upload image (OCI layout)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/upload-artifact@v7 - with: - name: 'docker-parent-base-app_ubuntu-22-04-${{ matrix.arch }}' - path: .ci-oci-image/base-app_ubuntu-22-04 - retention-days: 1 - overwrite: true - compression-level: 0 - if-no-files-found: error - base-app_ubuntu-22-04_publish: - name: 'webdevops/base-app:ubuntu-22.04 - Publish' - runs-on: ubuntu-latest - permissions: - packages: write - needs: base-app_ubuntu-22-04 - if: "${{github.ref == 'refs/heads/master'}}" - steps: - - - uses: docker/setup-buildx-action@v4 - - - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Login to hub.docker.com' - uses: docker/login-action@v4 - with: - username: '${{ secrets.DOCKERHUB_USERNAME }}' - password: '${{ secrets.DOCKERHUB_TOKEN }}' - - - name: 'Create and push multi-arch manifest' - run: |- - set -euo pipefail - for i in 1 2 3 4 5 6 7 8 9 10; do - docker buildx imagetools create \ - -t "webdevops/base-app:ubuntu-22.04" \ - -t "ghcr.io/webdevops/base-app:ubuntu-22.04" \ - -t "webdevops/base-app:latest" \ - -t "ghcr.io/webdevops/base-app:latest" \ - "ghcr.io/webdevops/base-app:sha-${{ github.sha }}-amd64-ubuntu-22.04" \ - "ghcr.io/webdevops/base-app:sha-${{ github.sha }}-arm64-ubuntu-22.04" && exit 0 - sleep $((i*i)) - done - exit 1 - base_ubuntu-22-04: - strategy: - fail-fast: false - matrix: - include: - - - arch: amd64 - runner: ubuntu-24.04 - platform: linux/amd64 - - - arch: arm64 - runner: ubuntu-24.04-arm - platform: linux/arm64 - name: 'webdevops/base:ubuntu-22.04 (${{ matrix.arch }})' - needs: - - bootstrap_ubuntu-22-04_publish - - image-test-runner - if: '${{ !failure() && !cancelled() }}' - runs-on: '${{ matrix.runner }}' - permissions: - contents: read - packages: write - container: webdevops/dockerfile-build-env - steps: - - - uses: actions/checkout@v7 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v4 - - - name: 'Download parent image (OCI layout): webdevops/bootstrap:ubuntu-22.04' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/download-artifact@v8 - with: - name: 'docker-parent-bootstrap_ubuntu-22-04-${{ matrix.arch }}' - path: .ci-oci-image/bootstrap_ubuntu-22-04 - - - name: 'Build (load locally)' - if: "${{ github.ref == 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/base/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/base:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/base:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/base:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - - - name: 'Build (load locally, from parent artifact)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/base/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/base:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/base:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/base:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/bootstrap:ubuntu-22.04=oci-layout://.ci-oci-image/bootstrap_ubuntu-22-04:ci-parent-image' - - - name: 'Download the image test runner' - id: download-image-test-runner - uses: actions/download-artifact@v8 - continue-on-error: true - with: - name: 'webdevops-image-tests-${{ matrix.arch }}' - path: .ci-image-test-runner - - - name: 'Load the image test runner' - id: load-image-test-runner - if: "${{ steps.download-image-test-runner.outcome == 'success' }}" - continue-on-error: true - run: 'docker load --input .ci-image-test-runner/webdevops-image-tests.tar && rm .ci-image-test-runner/webdevops-image-tests.tar' - - - name: 'Build the image test runner' - if: "${{ steps.load-image-test-runner.outcome != 'success' }}" - uses: docker/build-push-action@v7 - with: - context: . - file: ci/image-tests/Dockerfile - load: true - tags: webdevops-image-tests - cache-from: 'type=gha,scope=webdevops-image-tests-${{ matrix.arch }}' - - - name: 'run image tests' - run: 'make test-image-run IMAGE=webdevops/base:ubuntu-22.04 REFERENCE=ghcr.io/webdevops/base:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - - - if: "${{github.ref == 'refs/heads/master'}}" - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Push arch image' - if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/base:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04"' - - - name: 'Export image (OCI layout)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/base/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - cache-from: 'type=gha,scope=webdevops/base:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/base:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/bootstrap:ubuntu-22.04=oci-layout://.ci-oci-image/bootstrap_ubuntu-22-04:ci-parent-image' - outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/base_ubuntu-22-04' - - - name: 'Upload image (OCI layout)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/upload-artifact@v7 - with: - name: 'docker-parent-base_ubuntu-22-04-${{ matrix.arch }}' - path: .ci-oci-image/base_ubuntu-22-04 - retention-days: 1 - overwrite: true - compression-level: 0 - if-no-files-found: error - base_ubuntu-22-04_publish: - name: 'webdevops/base:ubuntu-22.04 - Publish' - runs-on: ubuntu-latest - permissions: - packages: write - needs: base_ubuntu-22-04 - if: "${{github.ref == 'refs/heads/master'}}" - steps: - - - uses: docker/setup-buildx-action@v4 - - - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Login to hub.docker.com' - uses: docker/login-action@v4 - with: - username: '${{ secrets.DOCKERHUB_USERNAME }}' - password: '${{ secrets.DOCKERHUB_TOKEN }}' - - - name: 'Create and push multi-arch manifest' - run: |- - set -euo pipefail - for i in 1 2 3 4 5 6 7 8 9 10; do - docker buildx imagetools create \ - -t "webdevops/base:ubuntu-22.04" \ - -t "ghcr.io/webdevops/base:ubuntu-22.04" \ - -t "webdevops/base:latest" \ - -t "ghcr.io/webdevops/base:latest" \ - "ghcr.io/webdevops/base:sha-${{ github.sha }}-amd64-ubuntu-22.04" \ - "ghcr.io/webdevops/base:sha-${{ github.sha }}-arm64-ubuntu-22.04" && exit 0 - sleep $((i*i)) - done - exit 1 - bootstrap_ubuntu-22-04: - strategy: - fail-fast: false - matrix: - include: - - - arch: amd64 - runner: ubuntu-24.04 - platform: linux/amd64 - - - arch: arm64 - runner: ubuntu-24.04-arm - platform: linux/arm64 - name: 'webdevops/bootstrap:ubuntu-22.04 (${{ matrix.arch }})' - needs: - - toolbox_latest_publish - - image-test-runner - if: '${{ !failure() && !cancelled() }}' - runs-on: '${{ matrix.runner }}' - permissions: - contents: read - packages: write - container: webdevops/dockerfile-build-env - steps: - - - uses: actions/checkout@v7 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v4 - - - name: 'Download parent image (OCI layout): webdevops/toolbox:latest' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/download-artifact@v8 - with: - name: 'docker-parent-toolbox_latest-${{ matrix.arch }}' - path: .ci-oci-image/toolbox_latest - - - name: 'Build (load locally)' - if: "${{ github.ref == 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/bootstrap/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/bootstrap:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/bootstrap:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/bootstrap:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - - - name: 'Build (load locally, from parent artifact)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/bootstrap/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/bootstrap:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/bootstrap:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/bootstrap:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/toolbox=oci-layout://.ci-oci-image/toolbox_latest:ci-parent-image' - - - name: 'Download the image test runner' - id: download-image-test-runner - uses: actions/download-artifact@v8 - continue-on-error: true - with: - name: 'webdevops-image-tests-${{ matrix.arch }}' - path: .ci-image-test-runner - - - name: 'Load the image test runner' - id: load-image-test-runner - if: "${{ steps.download-image-test-runner.outcome == 'success' }}" - continue-on-error: true - run: 'docker load --input .ci-image-test-runner/webdevops-image-tests.tar && rm .ci-image-test-runner/webdevops-image-tests.tar' - - - name: 'Build the image test runner' - if: "${{ steps.load-image-test-runner.outcome != 'success' }}" - uses: docker/build-push-action@v7 - with: - context: . - file: ci/image-tests/Dockerfile - load: true - tags: webdevops-image-tests - cache-from: 'type=gha,scope=webdevops-image-tests-${{ matrix.arch }}' - - - name: 'run image tests' - run: 'make test-image-run IMAGE=webdevops/bootstrap:ubuntu-22.04 REFERENCE=ghcr.io/webdevops/bootstrap:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04' - - - if: "${{github.ref == 'refs/heads/master'}}" - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Push arch image' - if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/bootstrap:sha-${{ github.sha }}-${{ matrix.arch }}-ubuntu-22.04"' - - - name: 'Export image (OCI layout)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/bootstrap/ubuntu-22.04 - platforms: '${{ matrix.platform }}' - cache-from: 'type=gha,scope=webdevops/bootstrap:ubuntu-22.04-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/bootstrap:ubuntu-22.04-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/toolbox=oci-layout://.ci-oci-image/toolbox_latest:ci-parent-image' - outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/bootstrap_ubuntu-22-04' - - - name: 'Upload image (OCI layout)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/upload-artifact@v7 - with: - name: 'docker-parent-bootstrap_ubuntu-22-04-${{ matrix.arch }}' - path: .ci-oci-image/bootstrap_ubuntu-22-04 - retention-days: 1 - overwrite: true - compression-level: 0 - if-no-files-found: error - bootstrap_ubuntu-22-04_publish: - name: 'webdevops/bootstrap:ubuntu-22.04 - Publish' - runs-on: ubuntu-latest - permissions: - packages: write - needs: bootstrap_ubuntu-22-04 - if: "${{github.ref == 'refs/heads/master'}}" - steps: - - - uses: docker/setup-buildx-action@v4 - - - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Login to hub.docker.com' - uses: docker/login-action@v4 - with: - username: '${{ secrets.DOCKERHUB_USERNAME }}' - password: '${{ secrets.DOCKERHUB_TOKEN }}' - - - name: 'Create and push multi-arch manifest' - run: |- - set -euo pipefail - for i in 1 2 3 4 5 6 7 8 9 10; do - docker buildx imagetools create \ - -t "webdevops/bootstrap:ubuntu-22.04" \ - -t "ghcr.io/webdevops/bootstrap:ubuntu-22.04" \ - -t "webdevops/bootstrap:latest" \ - -t "ghcr.io/webdevops/bootstrap:latest" \ - "ghcr.io/webdevops/bootstrap:sha-${{ github.sha }}-amd64-ubuntu-22.04" \ - "ghcr.io/webdevops/bootstrap:sha-${{ github.sha }}-arm64-ubuntu-22.04" && exit 0 - sleep $((i*i)) - done - exit 1 - dockerfile-build-env_latest: - strategy: - fail-fast: false - matrix: - include: - - - arch: amd64 - runner: ubuntu-24.04 - platform: linux/amd64 - - - arch: arm64 - runner: ubuntu-24.04-arm - platform: linux/arm64 - name: 'webdevops/dockerfile-build-env:latest (${{ matrix.arch }})' - needs: - - base-app_ubuntu-22-04_publish - - image-test-runner - if: '${{ !failure() && !cancelled() }}' - runs-on: '${{ matrix.runner }}' - permissions: - contents: read - packages: write - container: webdevops/dockerfile-build-env - steps: - - - uses: actions/checkout@v7 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v4 - - - name: 'Download parent image (OCI layout): webdevops/base-app:ubuntu-22.04' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: actions/download-artifact@v8 - with: - name: 'docker-parent-base-app_ubuntu-22-04-${{ matrix.arch }}' - path: .ci-oci-image/base-app_ubuntu-22-04 - - - name: 'Build (load locally)' - if: "${{ github.ref == 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/dockerfile-build-env/latest - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/dockerfile-build-env:sha-${{ github.sha }}-${{ matrix.arch }}-latest' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/dockerfile-build-env:latest-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/dockerfile-build-env:latest-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - - - name: 'Build (load locally, from parent artifact)' - if: "${{ github.ref != 'refs/heads/master' }}" - uses: docker/build-push-action@v7 - env: - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}' - with: - context: docker/dockerfile-build-env/latest - platforms: '${{ matrix.platform }}' - load: true - tags: 'ghcr.io/webdevops/dockerfile-build-env:sha-${{ github.sha }}-${{ matrix.arch }}-latest' - no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/dockerfile-build-env:latest-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/dockerfile-build-env:latest-${{ matrix.arch }},mode=max' - build-args: 'TARGETARCH=${{ matrix.arch }}' - secret-envs: COMPOSER_AUTH=COMPOSER_AUTH - build-contexts: 'webdevops/base-app:ubuntu-22.04=oci-layout://.ci-oci-image/base-app_ubuntu-22-04:ci-parent-image' - - - name: 'Download the image test runner' - id: download-image-test-runner - uses: actions/download-artifact@v8 - continue-on-error: true - with: - name: 'webdevops-image-tests-${{ matrix.arch }}' - path: .ci-image-test-runner - - - name: 'Load the image test runner' - id: load-image-test-runner - if: "${{ steps.download-image-test-runner.outcome == 'success' }}" - continue-on-error: true - run: 'docker load --input .ci-image-test-runner/webdevops-image-tests.tar && rm .ci-image-test-runner/webdevops-image-tests.tar' - - - name: 'Build the image test runner' - if: "${{ steps.load-image-test-runner.outcome != 'success' }}" - uses: docker/build-push-action@v7 - with: - context: . - file: ci/image-tests/Dockerfile - load: true - tags: webdevops-image-tests - cache-from: 'type=gha,scope=webdevops-image-tests-${{ matrix.arch }}' - - - name: 'run image tests' - run: 'make test-image-run IMAGE=webdevops/dockerfile-build-env:latest REFERENCE=ghcr.io/webdevops/dockerfile-build-env:sha-${{ github.sha }}-${{ matrix.arch }}-latest' - - - if: "${{github.ref == 'refs/heads/master'}}" - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Push arch image' - if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/dockerfile-build-env:sha-${{ github.sha }}-${{ matrix.arch }}-latest"' - dockerfile-build-env_latest_publish: - name: 'webdevops/dockerfile-build-env:latest - Publish' - runs-on: ubuntu-latest - permissions: - packages: write - needs: dockerfile-build-env_latest - if: "${{github.ref == 'refs/heads/master'}}" - steps: - - - uses: docker/setup-buildx-action@v4 - - - name: 'Login to ghcr.io' - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' - - - name: 'Login to hub.docker.com' - uses: docker/login-action@v4 - with: - username: '${{ secrets.DOCKERHUB_USERNAME }}' - password: '${{ secrets.DOCKERHUB_TOKEN }}' - - - name: 'Create and push multi-arch manifest' - run: |- - set -euo pipefail - for i in 1 2 3 4 5 6 7 8 9 10; do - docker buildx imagetools create \ - -t "webdevops/dockerfile-build-env:latest" \ - -t "ghcr.io/webdevops/dockerfile-build-env:latest" \ - "ghcr.io/webdevops/dockerfile-build-env:sha-${{ github.sha }}-amd64-latest" \ - "ghcr.io/webdevops/dockerfile-build-env:sha-${{ github.sha }}-arm64-latest" && exit 0 - sleep $((i*i)) - done - exit 1 php-apache-dev_8-2: strategy: fail-fast: false @@ -1276,7 +612,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -1385,7 +720,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -1566,7 +900,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -1675,7 +1008,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -1856,7 +1188,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -1965,7 +1296,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -2146,7 +1476,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -2255,7 +1584,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -2436,7 +1764,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -2545,7 +1872,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -2726,7 +2052,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -2861,7 +2186,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -3068,7 +2392,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -3203,7 +2526,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -3410,7 +2732,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -3545,7 +2866,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -3752,7 +3072,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -3887,7 +3206,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -4094,7 +3412,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -4229,7 +3546,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -4436,7 +3752,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -4545,7 +3860,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -4726,7 +4040,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -4835,7 +4148,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5016,7 +4328,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5125,7 +4436,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5306,7 +4616,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5415,7 +4724,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5596,7 +4904,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5705,7 +5012,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5886,7 +5192,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -5995,7 +5300,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -6176,7 +5480,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -6285,7 +5588,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -6466,7 +5768,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -6575,7 +5876,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -6756,7 +6056,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -6865,7 +6164,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -7046,7 +6344,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -7155,7 +6452,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -7336,7 +6632,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -7471,7 +6766,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -7678,7 +6972,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -7813,7 +7106,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -8020,7 +7312,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -8155,7 +7446,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -8362,7 +7652,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -8497,7 +7786,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -8704,7 +7992,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -8839,7 +8126,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -9046,7 +8332,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -9181,7 +8466,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -9392,7 +8676,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -9527,7 +8810,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -9738,7 +9020,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -9873,7 +9154,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -10084,7 +9364,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -10219,7 +9498,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -10430,7 +9708,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -10565,7 +9842,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 @@ -10770,7 +10046,6 @@ jobs: permissions: contents: read packages: write - container: webdevops/dockerfile-build-env steps: - uses: actions/checkout@v7 diff --git a/AGENTS.md b/AGENTS.md index 87ef74bf5..5fb4dc907 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,7 +66,7 @@ Where the documentation lives: | `docs/customization.md` | Commands, scripts at start and build time, tools for your Dockerfile, services, cron jobs and their time zone, healthcheck, configuration files and placeholders, supervisord, locales, application user and changing its UID | | `docs/images/*.md` | One page per image family: tags, base image, services, settings, development variant. `php.md` also has Debian or Alpine, production, installing extensions, mail and Xdebug with an IDE | | `docs/known-issues.md` | Options and tools that do not work, with affected images and workaround; migration from older images | -| `docs/discontinued-images.md` | Replacements for images and tags that are no longer built (`nginx`, `apache`, the `alpine` tags of `bootstrap`, `base` and `base-app`, `storage`, `vsftp`, `ssh`) or deprecated (`php-official`) | +| `docs/discontinued-images.md` | Replacements for images and tags that are no longer built (`bootstrap`, `base`, `base-app`, `dockerfile-build-env`, `nginx`, `apache`, `storage`, `vsftp`, `ssh`) or deprecated (`php-official`) | | `docs/dockerhub/*.md` | The pages on Docker Hub: a start page per built image with its tags and links into `docs/`, a warning per image that is no longer built. Generated from `conf/dockerhub.yml`; change the texts there | ### When to update it @@ -102,7 +102,7 @@ Update the documentation whenever a change touches any of these: Where you can, make the check an image test, so that the CI repeats it: a variable goes into `ENVIRONMENT` in `ci/image-tests/ImageTestCase.php`, the check of its effect into a trait in `ci/image-tests/Checks/`. - Check every image a statement names, not just one representative: images differ in what they inherit (for example `cli` runs `CLI_SCRIPT` as `application` in `base-app` and `php-*`, but as `root` in `base`, which has no user `application`). Check both the Debian and the Alpine variant whenever their implementation differs (separate files under `provisioning/*/alpine`, apk vs. apt, `httpd` vs. `apache2`, `crond` vs. `cron`). Test examples with the exact command you document, and make sure a check cannot pass on an error message. + Check every image a statement names, not just one representative: images differ in what they inherit (for example Postfix and the SSH server run only in the `-dev` images). Check both the Debian and the Alpine variant whenever their implementation differs (separate files under `provisioning/*/alpine`, apk vs. apt, `httpd` vs. `apache2`, `crond` vs. `cron`). Test examples with the exact command you document, and make sure a check cannot pass on an error message. 4. **Document only what works.** Never describe an option that has no effect as working. Fix it, or leave it out and list it in `docs/known-issues.md`. If it works only in some images, say exactly which. Anything `docs/known-issues.md` lists as not working must never appear as working anywhere else. An `ENV` line or a script that reads a variable is no proof that it works: `SERVICE_POSTFIX_OPTS` used to be passed to `postfix` after `start`, which ignored it. When you fix a known issue, remove its entry in the same pull request. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20f98d889..14bf00259 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ Edit the `Dockerfile.twig` templates, the shared templates in `template`, the fi `template/Dockerfile/layout.twig` writes the header of every Dockerfile and includes its `Dockerfile.twig`. A `Dockerfile.twig` imports the macros it uses from `template/Dockerfile`, e.g. `{% import 'docker.twig' as docker %}`; a macro imports the macros it calls itself. `generate:provision` empties the `conf/` directories of an image first, so a file removed from `provisioning` disappears there too. -The commands that the images have in `/usr/local/bin`, such as `apt-install`, `apk-install`, `docker-run-bootstrap` and `generate-locales`, are in `provisioning/baselayout/general/usr/local/bin`. They only handle Debian, Ubuntu and Alpine, the systems the images are built on. `generate:provision` copies them into `docker/toolbox/latest/conf/`, `toolbox` keeps them under `/baselayout`, and `bootstrap` and the PHP images copy them from there with `COPY --from=webdevops/toolbox`. +The commands that the images have in `/usr/local/bin`, such as `apt-install`, `apk-install`, `docker-run-bootstrap` and `generate-locales`, are in `provisioning/baselayout/general/usr/local/bin`. They only handle Debian, Ubuntu and Alpine: the images are built on Debian and Alpine, and the scripts also serve your own images on Ubuntu, see [Replacing discontinued images](docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). `generate:provision` copies them into `docker/toolbox/latest/conf/`, `toolbox` keeps them under `/baselayout`, and the PHP images copy them from there with `COPY --from=webdevops/toolbox`. It checks all of `conf/provision.yml` before it changes a file and stops if a source directory or a tag does not exist, or if an image has another setting than `configuration`. `generate:dockerfile` stops if a directory `docker//` has files but no `Dockerfile.twig`; it first removes the `.DS_Store` files of the macOS Finder under `docker`. To stop building a tag, remove its directory and those of the tags that build on it; `generate:github-ci` names any it finds. @@ -58,7 +58,9 @@ It does not update the actions in `.github/workflows/build.yaml`, because that f A new push to a pull request cancels the run of its previous commit. Runs on `master`, the nightly run and runs started by hand are never cancelled. GitHub Actions builds every image independently and runs the image tests -defined for it before pushing it to Docker Hub. The CI also uses `ghcr.io/webdevops/`, but only +defined for it before pushing it to Docker Hub. The jobs run directly on the GitHub-hosted runners, `ubuntu-24.04` for +`linux/amd64` and `ubuntu-24.04-arm` for `linux/arm64`, which have Docker, Buildx, git and make; they need no +container of their own. The CI also uses `ghcr.io/webdevops/`, but only internally; pull the images from Docker Hub. The job "Update the Docker Hub pages" uploads `docs/dockerhub/.md` and the short description of each repository to Docker Hub when `build.yaml` runs on `master` after a push or is started by hand. It does not run for pull requests, in the nightly run, in the builds that `php-upstream.yaml` starts (a failed upload would keep it from starting the next one) or in forks, and no other job waits for it. diff --git a/ci/image-tests/Checks/AdditionalServicesChecks.php b/ci/image-tests/Checks/AdditionalServicesChecks.php index 1901cbc8b..144b2e5db 100644 --- a/ci/image-tests/Checks/AdditionalServicesChecks.php +++ b/ci/image-tests/Checks/AdditionalServicesChecks.php @@ -7,8 +7,11 @@ use PHPUnit\Framework\Attributes\DataProvider; use Webdevops\Build\ImageTests\ImageTestCase; +use function array_diff; +use function array_values; + /** - * docker-service installs, enables and starts the services that webdevops/base does not run by default. It does so in a + * docker-service installs, enables and starts the services that the image does not run by default. It does so in a * container of its own, so that the container of the class keeps the services of the image. * * @phpstan-require-extends ImageTestCase @@ -20,13 +23,7 @@ trait AdditionalServicesChecks */ public static function additionalServices(): array { - return self::cases([ - 'cron', - 'dnsmasq', - 'postfix', - 'ssh', - 'syslog', - ]); + return self::cases(array_values(array_diff(['cron', 'dnsmasq', 'postfix', 'ssh', 'syslog'], self::services()))); } #[DataProvider('additionalServices')] diff --git a/ci/image-tests/Checks/BaseAppChecks.php b/ci/image-tests/Checks/BaseAppChecks.php index 9fc3d0d35..03a726ff1 100644 --- a/ci/image-tests/Checks/BaseAppChecks.php +++ b/ci/image-tests/Checks/BaseAppChecks.php @@ -14,7 +14,8 @@ use function trim; /** - * Checks of the images based on webdevops/base-app: the application user, locales and moreutils. + * Checks of the base-app layer of the images (template/Dockerfile/images/baseapp.twig and provisioning/base-app): the + * application user, locales and moreutils. * * @phpstan-require-extends ImageTestCase */ diff --git a/ci/image-tests/Checks/BaseChecks.php b/ci/image-tests/Checks/BaseChecks.php index b4304cc36..0a036967e 100644 --- a/ci/image-tests/Checks/BaseChecks.php +++ b/ci/image-tests/Checks/BaseChecks.php @@ -12,7 +12,8 @@ use function trim; /** - * Checks of the images based on webdevops/base: the layout under /opt/docker, supervisor and the tools. + * Checks of the base layer of the images (template/Dockerfile/images/base.twig and provisioning/base): the layout + * under /opt/docker, supervisor and the tools. * * @phpstan-require-extends ImageTestCase */ @@ -162,7 +163,7 @@ public function testDockerCronjobAddsAJobThatCronRunsAsItsUser(): void } /** - * The commands of webdevops/base, where the distribution has them: netstat and sed are in /bin in Alpine. + * The commands of the base layer, where the distribution has them: netstat and sed are in /bin in Alpine. * * @return iterable */ @@ -188,7 +189,7 @@ public function testBaseCommandIsOnThePath(string $command, string $path): void } /** - * The scripts and the configuration of webdevops/base have exactly the modes 0755 and 0644: no setuid, setgid or + * The scripts and the configuration of the base layer have exactly the modes 0755 and 0644: no setuid, setgid or * sticky bit. * * @return iterable diff --git a/ci/image-tests/Checks/BootstrapChecks.php b/ci/image-tests/Checks/BootstrapChecks.php index 5ff4f42d9..748bd23f2 100644 --- a/ci/image-tests/Checks/BootstrapChecks.php +++ b/ci/image-tests/Checks/BootstrapChecks.php @@ -15,7 +15,8 @@ use function sprintf; /** - * Checks of every image: the layout and tools of webdevops/bootstrap and the distribution. + * Checks of every image: the layout and the tools of the bootstrap layer (template/Dockerfile/images/bootstrap.twig and + * provisioning/baselayout) and the distribution. * * @phpstan-require-extends ImageTestCase */ @@ -146,8 +147,7 @@ public function testApkInstallsFromTheCache(): void } /** - * The variables of the locale and the terminal that webdevops/bootstrap and the PHP images set, and the PATH of the - * distribution and of the official PHP image. + * The variables of the locale and the terminal that the images set, and the PATH of the official PHP image. */ public function testLocaleTerminalAndPathOfTheImage(): void { @@ -195,8 +195,8 @@ public function testBootstrapCommandPermissions(string $path): void /** * gosu, with which the entrypoint runs commands as another user, is a program of root with the mode 0755 in the - * running container. webdevops/base and the PHP images build it with the setuid and setgid bits, so that their - * entrypoint can switch to root when the container starts as another user, and the entrypoint removes them. + * running container. The images build it with the setuid and setgid bits, so that their entrypoint can switch to + * root when the container starts as another user, and the entrypoint removes them. */ public function testGosuPermissions(): void { diff --git a/ci/image-tests/Checks/BuildEnvChecks.php b/ci/image-tests/Checks/BuildEnvChecks.php deleted file mode 100644 index 226658473..000000000 --- a/ci/image-tests/Checks/BuildEnvChecks.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ - public static function buildTools(): iterable - { - yield 'make' => ['make --version', '/\AGNU Make \d+\.\d+/']; - yield 'docker' => ['docker --version', '/\ADocker version \d+\.\d+\.\d+/']; - yield 'git' => ['git --version', '/\Agit version \d+\.\d+/']; - } - - #[DataProvider('buildTools')] - public function testBuildToolRuns(string $command, string $pattern): void - { - self::assertMatchesRegularExpression($pattern, $this->stdout($command)); - } - - public function testApplicationUserMayUseDocker(): void - { - self::assertContains('docker', explode(' ', trim($this->stdout('id -nG application')))); - } -} diff --git a/ci/image-tests/Checks/CliWithoutApplicationUserChecks.php b/ci/image-tests/Checks/CliWithoutApplicationUserChecks.php deleted file mode 100644 index bdb210fea..000000000 --- a/ci/image-tests/Checks/CliWithoutApplicationUserChecks.php +++ /dev/null @@ -1,25 +0,0 @@ -runContainer(['cli', '-un'], ['CLI_SCRIPT' => 'id']); - self::assertSame([0, "root\n"], [$result->exitCode, $result->stdout], $result->describe()); - } -} diff --git a/ci/image-tests/Checks/HealthcheckChecks.php b/ci/image-tests/Checks/HealthcheckChecks.php index db1d620b1..03928b502 100644 --- a/ci/image-tests/Checks/HealthcheckChecks.php +++ b/ci/image-tests/Checks/HealthcheckChecks.php @@ -74,7 +74,7 @@ public function testHealthcheckIgnoresAStoppedService(): void /** * From PHP 8.6 on, the PHP images run docker-healthcheck as their HEALTHCHECK and Docker reports them as healthy; - * the older PHP images and the base images have no HEALTHCHECK. + * the older PHP images have no HEALTHCHECK. */ public function testHealthcheckOfTheImage(): void { diff --git a/ci/image-tests/Checks/ServiceChecks.php b/ci/image-tests/Checks/ServiceChecks.php index e0d18b652..e992ff791 100644 --- a/ci/image-tests/Checks/ServiceChecks.php +++ b/ci/image-tests/Checks/ServiceChecks.php @@ -44,7 +44,7 @@ trait ServiceChecks ]; /** - * The services of webdevops/base that docker-service enable installs, see docs/customization.md#services. + * The services that docker-service enable installs, see docs/customization.md#services. */ private const array INSTALLABLE_SERVICES = ['cron', 'dnsmasq', 'postfix', 'ssh', 'syslog']; @@ -165,7 +165,7 @@ private function runningServices(?Container $container = null): array } /** - * The services of the image and the services of webdevops/base, each with its configuration in + * The services of the image and the services that docker-service enable installs, each with its configuration in * /opt/docker/etc/supervisor.d. * * @return iterable @@ -178,8 +178,8 @@ public static function supervisorPrograms(): iterable } /** - * supervisord starts the services of the image by itself (autostart = true), the other services of webdevops/base - * only once docker-service enable sets it. + * supervisord starts the services of the image by itself (autostart = true), the other services only once + * docker-service enable sets it. */ #[DataProvider('supervisorPrograms')] public function testServiceStartsAutomaticallyOnlyIfTheImageRunsIt(string $service): void diff --git a/ci/image-tests/Docker/Container.php b/ci/image-tests/Docker/Container.php index 35c11df6c..2ac299d76 100644 --- a/ci/image-tests/Docker/Container.php +++ b/ci/image-tests/Docker/Container.php @@ -50,8 +50,8 @@ private function __construct(public string $id) /** * Creates a container of $image, copies the files under each of $directories into its root directory and starts * it. Only files are copied: directories of the image keep their owner and mode, see FileArchive. stdin stays - * open, so that an image whose command is a shell, such as webdevops/bootstrap, keeps running. $labels are added - * to the container, e.g. to find and remove it later. + * open, so that an image whose command is a shell keeps running. $labels are added to the container, e.g. to find + * and remove it later. * * Returns once the entrypoint of the image has run its scripts, which write the configuration from the * environment, and has replaced itself with the command, e.g. supervisord. @@ -150,7 +150,7 @@ public function exec(string $command): CommandResult /** * Waits while process 1 is still the entrypoint, /opt/docker/bin/entrypoint.sh started as /entrypoint. Images - * without it, such as webdevops/bootstrap, are ready at once. + * without it are ready at once. */ private function waitForEntrypoint(): void { diff --git a/ci/image-tests/ImageUnderTest.php b/ci/image-tests/ImageUnderTest.php index 78a8da5e5..1e25198c9 100644 --- a/ci/image-tests/ImageUnderTest.php +++ b/ci/image-tests/ImageUnderTest.php @@ -115,8 +115,8 @@ public function isThreadSafe(): bool } /** - * The PHP images run docker-healthcheck as their HEALTHCHECK from PHP 8.6 on; the older ones and the base images - * only offer the command. + * The PHP images run docker-healthcheck as their HEALTHCHECK from PHP 8.6 on; the older ones only offer the + * command. */ public function hasHealthcheck(): bool { diff --git a/ci/image-tests/Images/BaseAppTest.php b/ci/image-tests/Images/BaseAppTest.php deleted file mode 100644 index 7342f0c59..000000000 --- a/ci/image-tests/Images/BaseAppTest.php +++ /dev/null @@ -1,26 +0,0 @@ -settings['docker']['autoLatestTag'] ?? null; + $docker = $this->settings['docker'] ?? null; + if (is_array($docker) && array_key_exists('autoLatestTag', $docker) && $docker['autoLatestTag'] === null) { + return null; + } + + $tag = is_array($docker) ? $docker['autoLatestTag'] ?? null : null; if (!is_string($tag) || $tag === '') { // An unquoted value such as 22.10 is a number in YAML and would lose its trailing zero - throw new RuntimeException('"docker: autoLatestTag" in conf/console.yml has to be a tag in quotes, e.g. \'ubuntu-22.04\'.'); + throw new RuntimeException('"docker: autoLatestTag" in conf/console.yml has to be a tag in quotes, e.g. \'ubuntu-22.04\', or ~ for none.'); } return $tag; @@ -213,7 +218,7 @@ public function getInfo(string $dockerfile): array * published alias for whichever folder `autoLatestTag` points to, and a * reference like "webdevops/base:latest" must resolve to * "webdevops/base:ubuntu-22.04" to match the job that actually builds - * and exports it. A few images (e.g. toolbox, dockerfile-build-env) *do* have a + * and exports it. A few images (e.g. toolbox) *do* have a * literal "latest" subdirectory and must be left untouched. Checking the * filesystem directly, rather than assuming the "latest" alias * substitution always applies, keeps this correct for both cases. @@ -233,8 +238,9 @@ private function resolveInternalImageReference(string $reference): string $dockerfileExists = fn (string $tag): bool => file_exists( $this->rootPath . '/docker/' . $image . '/' . $tag . '/Dockerfile', ); - if ($tag === 'latest' && !$dockerfileExists($tag) && $dockerfileExists($this->autoLatestTag())) { - $tag = $this->autoLatestTag(); + $latestTag = $this->autoLatestTag(); + if ($tag === 'latest' && !$dockerfileExists($tag) && $latestTag !== null && $dockerfileExists($latestTag)) { + $tag = $latestTag; } return 'webdevops/' . $image . ':' . $tag; diff --git a/ci/src/GithubJobBuilder.php b/ci/src/GithubJobBuilder.php index 3fe554793..8473ca405 100644 --- a/ci/src/GithubJobBuilder.php +++ b/ci/src/GithubJobBuilder.php @@ -175,10 +175,11 @@ public function getJobsDescription(array $node): array 'needs' => $needs, // even run if previous job skipped 'if' => '${{ !failure() && !cancelled() }}', + // The steps run on the runner itself, not in a container: the runner images for amd64 and arm64 have + // Docker, Buildx, git and make. 'runs-on' => '${{ matrix.runner }}', // pushes its image to ghcr.io on master and takes the parent images from there 'permissions' => self::PUSH_PERMISSIONS, - 'container' => 'webdevops/dockerfile-build-env', 'steps' => array_values( array_filter( [ @@ -454,14 +455,9 @@ private function getCiImageArtifactName(string $imageId): string * Predictable, collision-free extraction/export directory for the OCI * layout of the image identified by $imageId. * - * Intentionally a path relative to the job's working directory (the - * checked-out repository) rather than an absolute `${{ runner.temp }}` - * path: every job in this workflow runs inside a `container:`, and - * `${{ runner.temp }}` is evaluated by the Actions runner against the - * *host* filesystem, which is only bind-mounted into the container under - * `/__w/_temp`, not under the literal host path. A relative path is - * resolved consistently by every step (checkout, Buildx, up-/download-artifact) - * against the same container working directory, avoiding that mismatch. + * A path relative to the job's working directory (the checked-out + * repository), which every step (checkout, Buildx, up-/download-artifact) + * resolves the same way. */ private function getCiImagePath(string $imageId): string { diff --git a/ci/tests/FileReaderTest.php b/ci/tests/FileReaderTest.php index d45277ff4..5a7382de4 100644 --- a/ci/tests/FileReaderTest.php +++ b/ci/tests/FileReaderTest.php @@ -228,13 +228,28 @@ public function testAutoLatestTagHasToBeAQuotedTag(string $line): void try { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('"docker: autoLatestTag" in conf/console.yml has to be a tag in quotes, e.g. \'ubuntu-22.04\'.'); + $this->expectExceptionMessage('"docker: autoLatestTag" in conf/console.yml has to be a tag in quotes, e.g. \'ubuntu-22.04\', or ~ for none.'); new FileReader($repository->path)->getInfo('docker/base/ubuntu-22.04/Dockerfile'); } finally { $repository->remove(); } } + public function testNoTagIsPublishedAsLatestWithoutAutoLatestTag(): void + { + $repository = new TemporaryRepository(); + $repository->write('conf/console.yml', str_replace(" autoLatestTag: 'ubuntu-22.04'", ' autoLatestTag: ~', $repository->read('conf/console.yml'))); + + try { + $fileReader = new FileReader($repository->path); + self::assertNull($fileReader->autoLatestTag()); + self::assertSame([], $fileReader->getInfo('docker/base/ubuntu-22.04/Dockerfile')['aliases']); + self::assertSame('webdevops/base:latest', $fileReader->getInfo('docker/base-app/ubuntu-22.04/Dockerfile')['parent'], 'base has no latest any more'); + } finally { + $repository->remove(); + } + } + public function testDockerfileWithoutHeaderIsAnError(): void { $repository = new TemporaryRepository(); diff --git a/ci/tests/GithubJobBuilderTest.php b/ci/tests/GithubJobBuilderTest.php index bdc7d8544..9194b6db0 100644 --- a/ci/tests/GithubJobBuilderTest.php +++ b/ci/tests/GithubJobBuilderTest.php @@ -43,7 +43,7 @@ public function testBuildAndPublishJob(): void self::assertSame('webdevops/base:alpine (${{ matrix.arch }})', $jobs['base_alpine']['name']); self::assertSame(['fail-fast' => false, 'matrix' => ['include' => GithubJobBuilder::PLATFORMS]], $jobs['base_alpine']['strategy']); self::assertSame('${{ matrix.runner }}', $jobs['base_alpine']['runs-on']); - self::assertSame('webdevops/dockerfile-build-env', $jobs['base_alpine']['container']); + self::assertArrayNotHasKey('container', $jobs['base_alpine'], 'the steps run on the runner itself'); self::assertSame('base_alpine', $jobs['base_alpine_publish']['needs']); self::assertSame(['contents' => 'read', 'packages' => 'write'], $jobs['base_alpine']['permissions'], 'pushes to ghcr.io'); self::assertSame(['packages' => 'write'], $jobs['base_alpine_publish']['permissions'], 'pushes to ghcr.io, needs no checkout'); diff --git a/ci/tests/ImageTestsTest.php b/ci/tests/ImageTestsTest.php index 746615e16..a1e62a15a 100644 --- a/ci/tests/ImageTestsTest.php +++ b/ci/tests/ImageTestsTest.php @@ -36,7 +36,7 @@ public function testEveryImageWithTestsInTheRepositoryHasAClass(): void $imageTests = new ImageTests(__DIR__ . '/../..'); self::assertSame('ci/image-tests/Images/PhpNginxDevTest.php', $imageTests->testFile('php-nginx-dev')); - self::assertSame('ci/image-tests/Images/BaseAppTest.php', $imageTests->testFile('base-app')); + self::assertSame('ci/image-tests/Images/PhpApacheTest.php', $imageTests->testFile('php-apache')); self::assertNull($imageTests->testFile('toolbox')); } diff --git a/conf/console.yml b/conf/console.yml index 96d790b9c..166311d8d 100644 --- a/conf/console.yml +++ b/conf/console.yml @@ -2,8 +2,9 @@ # Settings of ci/console generate:github-ci and generate:readme-banner docker: - # This tag is also published as latest - autoLatestTag: 'ubuntu-22.04' + # The tag that is also published as latest, e.g. 'ubuntu-22.04'; ~ for none. The images with such a tag, + # bootstrap, base and base-app, are no longer built; the PHP images have no latest tag. + autoLatestTag: ~ # Deprecated image names that the CI also publishes an image under, only for the tags listed here. # webdevops/php-official is webdevops/php and gets no new tags, see docs/discontinued-images.md. aliases: diff --git a/conf/dockerhub.yml b/conf/dockerhub.yml index 3a77d47be..1e0491077 100644 --- a/conf/dockerhub.yml +++ b/conf/dockerhub.yml @@ -24,50 +24,6 @@ releases: # its newest tag. The PHP images use the tag of the README. # docs: links under "Documentation" built: - bootstrap: - short: 'Ubuntu 22.04 with the webdevops helper scripts, a base for your own images' - intro: 'The operating system plus the webdevops helper scripts, for example `docker-run-bootstrap`. A base for your own images and for [`webdevops/base`](https://hub.docker.com/r/webdevops/base).' - note: 'The `alpine` tag is no longer built, see [Replacing discontinued images](docs/discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app).' - example: - lang: 'dockerfile' - code: | - FROM {image} - COPY docker/bootstrap.d/ /bootstrap.d/ - RUN docker-run-bootstrap - docs: - - { label: 'webdevops/bootstrap, webdevops/base and webdevops/base-app', path: 'docs/images/base.md' } - - { label: 'Scripts at image build', path: 'docs/customization.md#scripts-at-image-build' } - - { label: 'Known issues', path: 'docs/known-issues.md' } - base: - short: 'Ubuntu 22.04 with entrypoint, supervisord, service scripts and hooks, a base for your own images' - intro: '[`webdevops/bootstrap`](https://hub.docker.com/r/webdevops/bootstrap) plus the entrypoint, `supervisord`, service scripts and hooks. A base for your own images.' - note: 'The `alpine` tag is no longer built, see [Replacing discontinued images](docs/discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app).' - example: - lang: 'dockerfile' - code: | - FROM {image} - COPY docker/bootstrap.d/ /bootstrap.d/ - RUN docker-run-bootstrap - docs: - - { label: 'webdevops/bootstrap, webdevops/base and webdevops/base-app', path: 'docs/images/base.md' } - - { label: 'Customization: commands, scripts, services and hooks', path: 'docs/customization.md' } - - { label: 'Environment variables', path: 'docs/environment-variables.md' } - - { label: 'Known issues', path: 'docs/known-issues.md' } - base-app: - short: 'webdevops/base with the user application, /app and tools such as git, rsync and the SSH client' - intro: '[`webdevops/base`](https://hub.docker.com/r/webdevops/base) plus the user and group `application` (UID/GID `1000`), `/app` and common tools: `zip`, `unzip`, `bzip2`, `git`, `patch`, `rsync`, the SSH client (`ssh`), a DNS lookup tool (`dig`) and `moreutils`. A base for your own images.' - note: 'The `alpine` tag is no longer built, see [Replacing discontinued images](docs/discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app).' - example: - lang: 'dockerfile' - code: | - FROM {image} - COPY docker/bootstrap.d/ /bootstrap.d/ - RUN docker-run-bootstrap - docs: - - { label: 'webdevops/bootstrap, webdevops/base and webdevops/base-app', path: 'docs/images/base.md' } - - { label: 'Customization: commands, scripts, services and hooks', path: 'docs/customization.md' } - - { label: 'Environment variables', path: 'docs/environment-variables.md' } - - { label: 'Known issues', path: 'docs/known-issues.md' } php: short: 'PHP-FPM on the official PHP image, configured with environment variables; Debian and Alpine' intro: 'PHP-FPM on top of the official PHP image, with the webdevops entrypoint, `supervisord`, cron, syslog-ng and the `application` user. PHP-FPM listens on port `9000`. For a web server in the same container, use [`webdevops/php-nginx`](https://hub.docker.com/r/webdevops/php-nginx) or [`webdevops/php-apache`](https://hub.docker.com/r/webdevops/php-apache).' @@ -203,15 +159,10 @@ built: - { label: 'Known issues', path: 'docs/known-issues.md' } toolbox: short: 'Build helper of the webdevops images: baselayout scripts, go-replace and gosu' - intro: 'Build helper, not meant to run. Stores the baselayout scripts (`apt-install`, `apk-install`, `docker-image-cleanup`, `docker-run-bootstrap`, `generate-locales` and more), `go-replace` and `gosu` under `/baselayout`. [`webdevops/bootstrap`](https://hub.docker.com/r/webdevops/bootstrap) and [`webdevops/php`](https://hub.docker.com/r/webdevops/php) copy them from there with `COPY --from=webdevops/toolbox`. In `toolbox` itself only `go-replace` is on the `PATH`.' + intro: 'Build helper, not meant to run. Stores the baselayout scripts (`apt-install`, `apk-install`, `docker-image-cleanup`, `docker-run-bootstrap`, `generate-locales` and more), `go-replace` and `gosu` under `/baselayout`. [`webdevops/php`](https://hub.docker.com/r/webdevops/php) copies them from there with `COPY --from=webdevops/toolbox`, and so can your own images, see [Replacing discontinued images](docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). In `toolbox` itself only `go-replace` is on the `PATH`.' docs: - { label: 'Images', path: 'docs/README.md#images' } - { label: 'How the images build on each other', path: 'docs/README.md#how-the-images-build-on-each-other' } - dockerfile-build-env: - short: 'Build environment of github.com/webdevops/Dockerfile, in which its CI builds the images' - intro: 'Build environment for [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile), based on [`webdevops/base-app`](https://hub.docker.com/r/webdevops/base-app). The CI builds and tests the images in it.' - docs: - - { label: 'Building in CI', path: 'CONTRIBUTING.md#building-in-ci' } # Images that are no longer built. # lastBuilt: month of the newest tag on Docker Hub @@ -228,8 +179,28 @@ discontinued: docs: 'docs/discontinued-images.md#webdevopsapache' apache-dev: lastBuilt: '2022-12' + base: + lastBuilt: '2026-11' + replacement: + image: 'webdevops/php:8.5' + url: 'https://hub.docker.com/r/webdevops/php' + docs: 'docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app' + base-app: + lastBuilt: '2026-11' + replacement: + image: 'webdevops/php:8.5' + url: 'https://hub.docker.com/r/webdevops/php' + docs: 'docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app' + bootstrap: + lastBuilt: '2026-11' + replacement: + image: 'ubuntu:22.04' + url: 'https://hub.docker.com/_/ubuntu' + docs: 'docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app' certbot: lastBuilt: '2022-12' + dockerfile-build-env: + lastBuilt: '2026-11' hhvm: lastBuilt: '2020-04' hhvm-apache: diff --git a/conf/provision.yml b/conf/provision.yml index 7f9740c32..eab54582e 100644 --- a/conf/provision.yml +++ b/conf/provision.yml @@ -1,11 +1,5 @@ --- provision: - base: - configuration: - base/general: '*' - base-app: - configuration: - base-app/general: '*' php-apache: configuration: apache/general : '*' diff --git a/docker/base-app/ubuntu-22.04/Dockerfile b/docker/base-app/ubuntu-22.04/Dockerfile deleted file mode 100644 index 134383c4a..000000000 --- a/docker/base-app/ubuntu-22.04/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -#+++++++++++++++++++++++++++++++++++++++ -# Dockerfile for webdevops/base-app:ubuntu-22.04 -# -- automatically generated -- -#+++++++++++++++++++++++++++++++++++++++ - -FROM webdevops/base:ubuntu-22.04 - -ENV APPLICATION_USER=application \ - APPLICATION_GROUP=application \ - APPLICATION_PATH=/app \ - APPLICATION_UID=1000 \ - APPLICATION_GID=1000 - -COPY conf/ /opt/docker/ - -RUN set -x \ - # Install services - && apt-install \ - # Install common tools - zip \ - unzip \ - bzip2 \ - moreutils \ - dnsutils \ - openssh-client \ - rsync \ - git \ - patch \ - && mkdir -p /var/lib/syslog-ng/ \ - && /usr/local/bin/generate-locales \ - && docker-run-bootstrap \ - && docker-image-cleanup diff --git a/docker/base-app/ubuntu-22.04/Dockerfile.twig b/docker/base-app/ubuntu-22.04/Dockerfile.twig deleted file mode 100644 index 43c67709a..000000000 --- a/docker/base-app/ubuntu-22.04/Dockerfile.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% import 'docker.twig' as docker %} -{% import 'provision.twig' as provision %} -{% import 'environment.twig' as environment %} -{% import 'images/baseapp.twig' as baseapp %} -{{ docker.from("base", "ubuntu-22.04") }} - -{{ environment.baseApp() }} - -{{ docker.copy('conf/', '/opt/docker/') }} - -RUN set -x \ - {{ baseapp.ubuntu() }} \ - {{ provision.runBootstrap() }} \ - {{ docker.cleanup() }} diff --git a/docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/10-user-application.sh b/docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/10-user-application.sh deleted file mode 100644 index 5bc865e80..000000000 --- a/docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/10-user-application.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Add group -groupadd -g "$APPLICATION_GID" "$APPLICATION_GROUP" - -# Add user -useradd -u "$APPLICATION_UID" --home "/home/application" --create-home --shell /bin/bash --no-user-group "$APPLICATION_USER" - -# Assign user to group -usermod -g "$APPLICATION_GROUP" "$APPLICATION_USER" diff --git a/docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/20-app.sh b/docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/20-app.sh deleted file mode 100644 index 749966b67..000000000 --- a/docker/base-app/ubuntu-22.04/conf/provision/bootstrap.d/20-app.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Create /app folder -mkdir -p /app -chown "$APPLICATION_USER":"$APPLICATION_GROUP" /app diff --git a/docker/base/ubuntu-22.04/Dockerfile b/docker/base/ubuntu-22.04/Dockerfile deleted file mode 100644 index ac0736202..000000000 --- a/docker/base/ubuntu-22.04/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -#+++++++++++++++++++++++++++++++++++++++ -# Dockerfile for webdevops/base:ubuntu-22.04 -# -- automatically generated -- -#+++++++++++++++++++++++++++++++++++++++ - -FROM webdevops/bootstrap:ubuntu-22.04 - -ENV DOCKER_CONF_HOME=/opt/docker/ \ - LOG_STDOUT="" \ - LOG_STDERR="" - -COPY conf/ /opt/docker/ - -RUN set -x \ - # Install services - && chmod +x /opt/docker/bin/* \ - && apt-install \ - supervisor \ - wget \ - curl \ - vim \ - net-tools \ - tzdata \ - && chmod +s /sbin/gosu \ - && docker-run-bootstrap \ - && docker-image-cleanup - -ENTRYPOINT ["/entrypoint"] -CMD ["supervisord"] diff --git a/docker/base/ubuntu-22.04/Dockerfile.twig b/docker/base/ubuntu-22.04/Dockerfile.twig deleted file mode 100644 index 9bc947d18..000000000 --- a/docker/base/ubuntu-22.04/Dockerfile.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% import 'docker.twig' as docker %} -{% import 'provision.twig' as provision %} -{% import 'environment.twig' as environment %} -{% import 'images/base.twig' as base %} -{{ docker.from("bootstrap", "ubuntu-22.04") }} - -{{ environment.base() }} - -{{ docker.copy('conf/', '/opt/docker/') }} - -RUN set -x \ - {{ base.ubuntu() }} \ - {{ provision.runBootstrap() }} \ - {{ docker.cleanup() }} - -{{ docker.entrypoint("/entrypoint") }} -{{ docker.cmd("supervisord") }} diff --git a/docker/base/ubuntu-22.04/conf/VERSION b/docker/base/ubuntu-22.04/conf/VERSION deleted file mode 100644 index 301160a93..000000000 --- a/docker/base/ubuntu-22.04/conf/VERSION +++ /dev/null @@ -1 +0,0 @@ -8 \ No newline at end of file diff --git a/docker/base/ubuntu-22.04/conf/bin/bootstrap.sh b/docker/base/ubuntu-22.04/conf/bin/bootstrap.sh deleted file mode 100644 index b1b3acdbc..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/bootstrap.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -exec docker-run-bootstrap diff --git a/docker/base/ubuntu-22.04/conf/bin/config.sh b/docker/base/ubuntu-22.04/conf/bin/config.sh deleted file mode 100644 index 46265a3c0..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/config.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob - -### - # Check if current user is root - # - ## -function rootCheck() { - # Root check - if [ "$(/usr/bin/whoami)" != "root" ]; then - echo "[ERROR] $* must be run as root" - exit 1 - fi -} - -### - # Create /docker.stdout and /docker.stderr - # - ## -function createDockerStdoutStderr() { - # link stdout from docker - if [[ -n "$LOG_STDOUT" ]]; then - echo "Log stdout redirected to $LOG_STDOUT" - else - LOG_STDOUT="/proc/$$/fd/1" - fi - - if [[ -n "$LOG_STDERR" ]]; then - echo "Log stderr redirected to $LOG_STDERR" - else - LOG_STDERR="/proc/$$/fd/2" - fi - - ln -f -s "$LOG_STDOUT" /docker.stdout - ln -f -s "$LOG_STDERR" /docker.stderr -} -### - # Include script directory text inside a file - # - # $1 -> path - # - ## -function includeScriptDir() { - if [[ -d "$1" ]]; then - for FILE in "$1"/*.sh; do - echo "-> Executing ${FILE}" - # run custom scripts, only once - . "$FILE" - done - fi -} - -### - # Show deprecation notice - # - ## -function deprecationNotice() { - echo "" - echo "###############################################################################" - echo "### THIS CALL IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE" - echo "###" - echo "### $*" - echo "###" - echo "###############################################################################" - echo "" -} - -### - # Run "entrypoint" scripts - ## -function runEntrypoints() { - ############### - # Try to find entrypoint - ############### - - ENTRYPOINT_SCRIPT="/opt/docker/bin/entrypoint.d/${TASK}.sh" - - if [ -f "$ENTRYPOINT_SCRIPT" ]; then - . "$ENTRYPOINT_SCRIPT" - fi - - ############### - # Run default - ############### - if [ -f "/opt/docker/bin/entrypoint.d/default.sh" ]; then - . /opt/docker/bin/entrypoint.d/default.sh - fi - - exit 1 -} - - # Run "entrypoint" provisioning - ## -function runProvisionEntrypoint() { - includeScriptDir "/opt/docker/provision/entrypoint.d" - includeScriptDir "/entrypoint.d" -} - -### - # List environment variables (based on prefix) - ## -function envListVars() { - if [[ $# -eq 1 ]]; then - env | grep "^${1}" | cut -d= -f1 - else - env | cut -d= -f1 - fi -} - -### - # Get environment variable (even with dots in name) - # - ## -function envGetValue() { - awk "BEGIN {print ENVIRON[\"$1\"]}" -} diff --git a/docker/base/ubuntu-22.04/conf/bin/control.sh b/docker/base/ubuntu-22.04/conf/bin/control.sh deleted file mode 100644 index 72111f395..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/control.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -source /opt/docker/bin/config.sh - -rootCheck "$0" - -CONTROL_COMMAND="$1" -shift - -case "$CONTROL_COMMAND" in - - ## ------------------------------------------ - ## Service - ## ------------------------------------------ - - "service.enable") - deprecationNotice " Please use >>docker-service-enable [service]<<" - docker-service-enable "$1" - ;; - - "service.disable") - deprecationNotice " Please use >>docker-service-disable [service]<<" - docker-service-disable "$1" - ;; - - ## ------------------------------------------ - ## Version - ## ------------------------------------------ - - "version.get") - cat /opt/docker/VERSION - ;; - - "version.require.min") - EXPECTED_VERSION="$1" - CURRENT_VERSION="$(cat /opt/docker/VERSION)" - if [ "$CURRENT_VERSION" -lt "$EXPECTED_VERSION" ]; then - echo "-----------------------------------------------------------" - echo "--- This docker image is not up2date!" - echo "--- " - echo "--- Version expected min: $EXPECTED_VERSION" - echo "--- Version current: $CURRENT_VERSION" - echo "--- " - echo "--- Run 'docker pull ' to update image" - echo "-----------------------------------------------------------" - exit 1 - fi - ;; - - "version.require.max") - EXPECTED_VERSION="$1" - CURRENT_VERSION="$(cat /opt/docker/VERSION)" - if [ "$CURRENT_VERSION" -gt "$EXPECTED_VERSION" ]; then - echo "-----------------------------------------------------------" - echo "--- This docker image is too new!" - echo "--- " - echo "--- Version expected max: $EXPECTED_VERSION" - echo "--- Version current: $CURRENT_VERSION" - echo "-----------------------------------------------------------" - exit 1 - fi - ;; - - - "buildtime.get") - cat /opt/docker/BUILDTIME - ;; - - *) - echo "[ERROR] Invalid controll command: \"${CONTROL_COMMAND}\"" - exit 1 - ;; -esac diff --git a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/cli.sh b/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/cli.sh deleted file mode 100644 index e2fe63e65..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/cli.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -############################################# -## Run CLI_SCRIPT from environment variable -############################################# - -if [[ -n "${CLI_SCRIPT:-}" ]]; then - # Pass on the arguments after "cli" - shift - if [[ -n "${APPLICATION_USER:-}" ]]; then - exec gosu "${APPLICATION_USER}" ${CLI_SCRIPT} "$@" - elif id -u application > /dev/null 2>&1; then - # APPLICATION_USER not set or empty: its default - exec gosu application ${CLI_SCRIPT} "$@" - else - # Neither APPLICATION_USER nor the user application, as in webdevops/base: run as root - exec ${CLI_SCRIPT} "$@" - fi -else - echo "[ERROR] No CLI_SCRIPT in docker environment defined" >&2 - exit 1 -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/default.sh b/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/default.sh deleted file mode 100644 index a1be715fe..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/default.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -exec "$@" diff --git a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/noop.sh b/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/noop.sh deleted file mode 100644 index 092d55d8b..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/noop.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -############################################# -## NOOP (no operation) -############################################# - -exec tail -f /dev/null diff --git a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/root.sh b/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/root.sh deleted file mode 100644 index 6fa0d063e..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/root.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -############################################# -## Root shell -############################################# - -if [ "$#" -eq 1 ]; then - ## No command, fall back to interactive shell - exec bash -else - ## Exec root command - shift - exec "$@" -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/supervisord.sh b/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/supervisord.sh deleted file mode 100644 index f21489667..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/entrypoint.d/supervisord.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -############################################# -## Supervisord (start daemons) -############################################# - -## Start services -exec /opt/docker/bin/service.d/supervisor.sh - diff --git a/docker/base/ubuntu-22.04/conf/bin/entrypoint.sh b/docker/base/ubuntu-22.04/conf/bin/entrypoint.sh deleted file mode 100644 index 0489b796c..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/entrypoint.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -if [[ -z "$CONTAINER_UID" ]]; then - export CONTAINER_UID="application" -fi - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -# auto elevate privileges (if container is not started as root) -if [[ "$UID" -ne 0 ]]; then - export CONTAINER_UID="$UID" - exec gosu root "$0" "$@" -fi -# remove suid bit on gosu -chmod -s /sbin/gosu - -trap 'echo sigterm ; exit' SIGTERM -trap 'echo sigkill ; exit' SIGKILL - -# sanitize input and set task -TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" - -source /opt/docker/bin/config.sh - -createDockerStdoutStderr - -if [[ "$UID" -eq 0 ]]; then - # Only run provision if user is root - - if [ "$TASK" == "supervisord" -o "$TASK" == "noop" ]; then - # Visible provisioning - runProvisionEntrypoint - else - # Hidden provisioning - runProvisionEntrypoint > /dev/null - fi -fi - -############################# -## COMMAND -############################# - -runEntrypoints "$@" diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/cron.d/10-init.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/cron.d/10-init.sh deleted file mode 100644 index 611edc9bf..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/cron.d/10-init.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Install crontab files - -if [[ -d "/opt/docker/etc/cron" ]]; then - mkdir -p /etc/cron.d/ - - find /opt/docker/etc/cron -type f | while read CRONTAB_FILE; do - # fix permissions - chmod 0644 -- "$CRONTAB_FILE" - - # add newline, cron needs this - echo >> "$CRONTAB_FILE" - - # Install files - cp -a -- "$CRONTAB_FILE" "/etc/cron.d/$(basename "$CRONTAB_FILE")" - done -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/cron.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/cron.sh deleted file mode 100644 index b5fa80dd3..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/cron.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Init vars -if [[ -z "$SERVICE_CRON_OPTS" ]]; then SERVICE_CRON_OPTS=""; fi - -source /opt/docker/bin/config.sh - -includeScriptDir "/opt/docker/bin/service.d/cron.d/" - -exec /usr/sbin/cron -f $SERVICE_CRON_OPTS diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.d/10-init.sh deleted file mode 100644 index 907e125fe..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.d/10-init.sh +++ /dev/null @@ -1,37 +0,0 @@ -# Create dnsmasq.d directory if not exists -mkdir -p -- /etc/dnsmasq.d/ - -# Enable /etc/dnsmasq.d/ -go-replace --mode=lineinfile --once \ - -s 'conf-dir' -r 'conf-dir=/etc/dnsmasq.d/,*.conf' \ - -- /etc/dnsmasq.conf - -## clear dns file -echo > /etc/dnsmasq.d/webdevops.conf - -if [ ! -f /etc/resolv.conf.original ]; then - cp -a /etc/resolv.conf /etc/resolv.conf.original - - ## set forward servers - cat /etc/resolv.conf.original | grep nameserver | sed 's/nameserver /server=/' > /etc/dnsmasq.d/forward.conf - - ## set dnsmasq to main nameserver - echo "nameserver 127.0.0.1" > /etc/resolv.conf -fi - - -# Add own VIRTUAL_HOST as loopback -if [[ -n "${VIRTUAL_HOST+x}" ]]; then - # split comma by space - VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} - - # replace each *.domain for dns specific .domain wildcard - VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST//\*./.} - - # no support for .* - VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST//.\*/.} - - for DOMAIN in $VIRTUAL_HOST_LIST; do - echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops.conf - done -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.sh deleted file mode 100644 index b8b4c12e0..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/dnsmasq.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Init vars -if [[ -z "$SERVICE_DNSMASQ_OPTS" ]]; then SERVICE_DNSMASQ_OPTS=""; fi -if [[ -z "$SERVICE_DNSMASQ_USER" ]]; then SERVICE_DNSMASQ_USER="root"; fi - -source /opt/docker/bin/config.sh - -includeScriptDir "/opt/docker/bin/service.d/dnsmasq.d/" - -exec dnsmasq --keep-in-foreground --user="$SERVICE_DNSMASQ_USER" $SERVICE_DNSMASQ_OPTS diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/postfix.d/10-init.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/postfix.d/10-init.sh deleted file mode 100644 index e1951d0ec..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/postfix.d/10-init.sh +++ /dev/null @@ -1,32 +0,0 @@ -# force new copy of hosts there (otherwise links could be outdated) -mkdir -p /var/spool/postfix/etc -cp -f /etc/hosts /var/spool/postfix/etc/hosts -cp -f /etc/resolv.conf /var/spool/postfix/etc/resolv.conf -cp -f /etc/services /var/spool/postfix/etc/services - -go-replace --mode=line --regex -s '^[\s]*myhostname[\s]*=.*' -r "myhostname = $HOSTNAME" - -# General; without SMTPUTF8, mail with UTF-8 in its headers also reaches a relay host that does not offer it, such -# as many mail catchers -go-replace --mode=lineinfile --regex \ - -s '^[\s]*myhostname[\s]*=.*.*' -r "myhostname = $HOSTNAME" \ - -s '^[\s]*inet_interfaces[\s]*=.*' -r "inet_interfaces = 127.0.0.1" \ - -s '^[\s]*smtputf8_enable[\s]*=.*' -r "smtputf8_enable = no" \ - -- /etc/postfix/main.cf - -## REPLAYHOST -if [[ -n "${POSTFIX_RELAYHOST+x}" ]]; then - go-replace --mode=lineinfile --regex \ - -s '^[\s]*relayhost[\s]*=.*' -r "relayhost = $POSTFIX_RELAYHOST" \ - -- /etc/postfix/main.cf -fi - -## MYNETWORKS -if [[ -n "${POSTFIX_MYNETWORKS+x}" ]]; then - go-replace --mode=lineinfile --regex \ - -s '^[\s]*mynetworks[\s]*=.*' -r "mynetworks = $POSTFIX_MYNETWORKS" \ - -- /etc/postfix/main.cf -fi - -# generate aliases db -newaliases || : diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/postfix.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/postfix.sh deleted file mode 100644 index 01855a061..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/postfix.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# Runs Postfix for supervisord (etc/supervisor.d/postfix.conf). "postfix start" puts the master process of Postfix in -# the background, so this script waits until it ends and passes the signals of supervisord on as "postfix stop" and -# "postfix reload". SERVICE_POSTFIX_OPTS holds options of the postfix command, e.g. -v, given before each command. - -# Init vars -if [[ -z "$SERVICE_POSTFIX_OPTS" ]]; then SERVICE_POSTFIX_OPTS=""; fi - -source /opt/docker/bin/config.sh - -trap "postfix $SERVICE_POSTFIX_OPTS stop" SIGINT -trap "postfix $SERVICE_POSTFIX_OPTS stop" SIGTERM -trap "postfix $SERVICE_POSTFIX_OPTS reload" SIGHUP - -includeScriptDir "/opt/docker/bin/service.d/postfix.d/" - -# A failed start, e.g. because of an unknown option in SERVICE_POSTFIX_OPTS, ends the script with an error before the -# startsecs of postfix.conf, so that supervisord gives up after a few attempts instead of restarting it over and over -if ! postfix $SERVICE_POSTFIX_OPTS start; then - echo "postfix $SERVICE_POSTFIX_OPTS start failed" >&2 - exit 1 -fi - -# lets give postfix some time to start -sleep 3 - -# wait until postfix is dead (triggered by trap) -if [[ -f /var/spool/postfix/pid/master.pid ]]; then - while kill -0 "$(cat /var/spool/postfix/pid/master.pid 2>/dev/null)" &>/dev/null; do - sleep 5 - done -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/ssh.d/10-init.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/ssh.d/10-init.sh deleted file mode 100644 index f2b600312..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/ssh.d/10-init.sh +++ /dev/null @@ -1,7 +0,0 @@ -# Init ssh privilege separation directory -mkdir -p /var/run/sshd -chown root:root /var/run/sshd -chmod 755 /var/run/sshd - -# generate host keys -ssh-keygen -A diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/ssh.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/ssh.sh deleted file mode 100644 index f01e87ab3..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/ssh.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Init vars -if [[ -z "$SERVICE_SSH_OPTS" ]]; then SERVICE_SSH_OPTS=""; fi - -source /opt/docker/bin/config.sh - -includeScriptDir "/opt/docker/bin/service.d/ssh.d/" - -exec /usr/sbin/sshd -D $SERVICE_SSH_OPTS diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.d/10-init.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.d/10-init.sh deleted file mode 100644 index fdffa2a0f..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.d/10-init.sh +++ /dev/null @@ -1 +0,0 @@ -# placeholder diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.sh deleted file mode 100644 index 5a82a13ff..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/supervisor.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Init vars -if [[ -z "$SERVICE_SUPERVISOR_OPTS" ]]; then SERVICE_SUPERVISOR_OPTS=""; fi -if [[ -z "$SERVICE_SUPERVISOR_USER" ]]; then SERVICE_SUPERVISOR_USER="root"; fi - -source /opt/docker/bin/config.sh - -includeScriptDir "/opt/docker/bin/service.d/supervisor.d/" - -exec supervisord -c /opt/docker/etc/supervisor.conf --logfile /dev/null --pidfile /dev/null --user "$SERVICE_SUPERVISOR_USER" $SERVICE_SUPERVISOR_OPTS diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.d/10-init.sh deleted file mode 100644 index 326207e52..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.d/10-init.sh +++ /dev/null @@ -1,10 +0,0 @@ -# If /dev/log is either a named pipe or it was placed there accidentally, -# e.g. because of the issue documented at https://github.com/phusion/baseimage-docker/pull/25, -# then we remove it. -if [ ! -S /dev/log ]; then rm -f /dev/log; fi -if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -if [[ ! -p /docker.stdout ]]; then - # Switch to file (tty docker mode) - go-replace -s 'pipe("/docker.stdout")' -r 'file("/docker.stdout")' -- /opt/docker/etc/syslog-ng/syslog-ng.conf -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.sh b/docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.sh deleted file mode 100644 index 8e1358c1b..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/service.d/syslog-ng.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Init vars -if [[ -z "$SERVICE_SYSLOG_OPTS" ]]; then SERVICE_SYSLOG_OPTS=""; fi - -source /opt/docker/bin/config.sh - -includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" - -exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS $SERVICE_SYSLOG_OPTS diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/container-file-auto-restore b/docker/base/ubuntu-22.04/conf/bin/usr-bin/container-file-auto-restore deleted file mode 100644 index a41fcb3c8..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/container-file-auto-restore +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail ## trace ERR through pipes -set -o errtrace ## trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -if [[ "$#" -ne 1 ]]; then - echo "Usage: $0 " - exit 1 -fi - -SOURCE_FILE="$1" -BACKUP_FILE="$(dirname "$1")/.$(basename "$1").bak" - -if [[ -f "$BACKUP_FILE" ]]; then - ## Backup file exists - ## -> container was restarted - ## -> restoring configuration - cp -a -- "$BACKUP_FILE" "$SOURCE_FILE" -else - ## Backup file DOESN'T exists - ## -> container first startup - ## -> backup configuration - cp -a -- "$SOURCE_FILE" "$BACKUP_FILE" -fi diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-cronjob b/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-cronjob deleted file mode 100644 index ca4aacb1b..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-cronjob +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -source /opt/docker/bin/config.sh - -rootCheck "$0" - -if [[ "$#" -eq 0 ]]; then - echo "Usage: $0 ''" - exit 1 -fi - -if [[ "$(docker-image-info family)" == "Alpine" ]]; then - # BusyBox crond reads no /etc/cron.d, but one crontab per user in /etc/crontabs, without the user column - for CRONJOB_LINE in "$@"; do - # time (five fields or one such as @daily), user, command - if [[ ! "$CRONJOB_LINE" =~ ^[[:space:]]*(@[[:alpha:]]+|[^@#[:space:]]+([[:space:]]+[^[:space:]]+){4})[[:space:]]+([^[:space:]]+)[[:space:]]+([^[:space:]].*)$ ]]; then - echo "[ERROR] Not a cron job line with the time, the user and the command: $CRONJOB_LINE" - exit 1 - fi - - CRONJOB_USER="${BASH_REMATCH[3]}" - if ! id -u "$CRONJOB_USER" > /dev/null 2>&1; then - echo "[ERROR] User '${CRONJOB_USER}' does not exist: $CRONJOB_LINE" - exit 1 - fi - - echo "${BASH_REMATCH[1]} ${BASH_REMATCH[4]}" >> "/etc/crontabs/${CRONJOB_USER}" - chmod 0600 "/etc/crontabs/${CRONJOB_USER}" - done - - exit 0 -fi - -# create crontab file -touch /etc/cron.d/webdevops-docker -chmod 0644 /etc/cron.d/webdevops-docker - -for CRONJOB_LINES in "$@"; do - echo "$CRONJOB_LINES" >> /etc/cron.d/webdevops-docker -done - -# Add required newline at end -echo >> /etc/cron.d/webdevops-docker diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-healthcheck b/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-healthcheck deleted file mode 100644 index e673ef815..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-healthcheck +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -# Checks the services of supervisord, for a HEALTHCHECK of Docker or a healthcheck in compose.yaml. -# -# Unhealthy (exit code 1): a service that supervisord gave up on (FATAL), that it is restarting after a failed start -# (BACKOFF) or whose state it does not know (UNKNOWN), and a supervisord that does not answer. The lines of those -# services are printed. -# Healthy (exit code 0): services that run or start (RUNNING, STARTING), that are not enabled or were stopped (STOPPED) -# and that ended (EXITED): supervisorctl status does not say whether a service ended as expected, and the services of -# the images are restarted when they end. supervisorctl status itself ends with an error as soon as a service is -# STOPPED, so only the states count. -# -# Docker keeps the output of a check only in docker inspect, so each failed check also writes its reason to the -# container log (docker logs), through the stderr of supervisord (PID 1), and the first check that passes after one -# that failed writes "healthy again" there. - -set -o pipefail - -CONTAINER_LOG=/proc/1/fd/2 -FAILED_MARKER=/run/docker-healthcheck.failed - -# Writes $1 to the container log, each line with the prefix "docker-healthcheck: "; without the permission to (not -# root), the check itself still counts -containerLog() { - { sed 's/^/docker-healthcheck: /' <<<"$1" > "$CONTAINER_LOG"; } 2>/dev/null || true -} - -unhealthy() { - echo "$1" - containerLog "unhealthy: $1" - { : > "$FAILED_MARKER"; } 2>/dev/null || true - exit 1 -} - -status=$(supervisorctl status 2>&1) - -if ! grep -qE '^\S+\s+(RUNNING|STARTING|STOPPED|STOPPING|EXITED|BACKOFF|FATAL|UNKNOWN)\b' <<<"$status"; then - unhealthy "supervisord does not answer: -$status" -fi - -failed=$(grep -E '^\S+\s+(FATAL|BACKOFF|UNKNOWN)\b' <<<"$status") -if [[ -n "$failed" ]]; then - unhealthy "$failed" -fi - -if [[ -e "$FAILED_MARKER" ]] && rm -f "$FAILED_MARKER" 2>/dev/null; then - containerLog "healthy again" -fi - -exit 0 diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service b/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service deleted file mode 100644 index 70a493767..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -if [[ "$#" -le 1 ]]; then - echo "Usage: $0 " - exit 1 -fi - -SERVICE_COMMAND=$1 -shift - -for SERVICE in "$@"; do - RUN_FILE="/opt/docker/bin/service.d/${SERVICE}.sh" - SERVICE_FILE="/opt/docker/etc/supervisor.d/${SERVICE}.conf" - PROVISION_FILE="/opt/docker/provision/service.d/${SERVICE}.sh" - - case "$SERVICE_COMMAND" in - enable) - # Run on demand installation/provisioning - if [[ -f "$PROVISION_FILE" ]]; then - echo "Running provisioning for ${SERVICE}, please wait..." - - ## execute scripts - . "$PROVISION_FILE" - - ## remove directory (one run time) - rm -f -- "$PROVISION_FILE" - fi - - ## Enable service - if [[ -f "$SERVICE_FILE" ]]; then - go-replace --mode=lineinfile \ - -s 'autostart =' -r 'autostart = true' \ - -- "$SERVICE_FILE" - else - echo "[ERROR] Service '${SERVICE}' not found (tried ${SERVICE_FILE})" - exit 1 - fi - ;; - - disable) - ## Disable service - if [[ -f "$SERVICE_FILE" ]]; then - go-replace --mode=lineinfile \ - -s 'autostart =' -r 'autostart = false' \ - -- "$SERVICE_FILE" - else - echo "[ERROR] Service '${SERVICE}' not found (tried ${SERVICE_FILE})" - exit 1 - fi - ;; - - install) - # Run on demand installation/provisioning - if [[ -f "$PROVISION_FILE" ]]; then - echo "Running provisioning for ${SERVICE}, please wait..." - - ## execute scripts - . "$PROVISION_FILE" - - ## remove directory (one run time) - rm -f -- "$PROVISION_FILE" - fi - ;; - - run) - if [[ -f "$RUN_FILE" ]]; then - exec "$RUN_FILE" - else - echo "[ERROR] Service '${SERVICE}' not found (tried ${RUN_FILE})" - exit 1 - fi - ;; - - stop|start|restart|status|pid|check) - service "${SERVICE}" "$SERVICE_COMMAND" - ;; - - *) - echo "[ERROR] $SERVICE_COMMAND is not a valid command" - exit 1 - ;; - esac -done - diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-disable b/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-disable deleted file mode 100644 index 991f249c8..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-disable +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -exec docker-service disable "$@" diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-enable b/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-enable deleted file mode 100644 index da99c9aeb..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/docker-service-enable +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -exec docker-service enable "$@" - diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/service b/docker/base/ubuntu-22.04/conf/bin/usr-bin/service deleted file mode 100755 index 69874cb80..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/service +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -# Root check -if [ "$(/usr/bin/whoami)" != "root" ]; then - echo "[ERROR] Must be run as root" - exit 1 -fi - -function serviceHelp() { - echo "Usage: $(basename "$0") " -} - -function getServicePid() { - local serviceName="$1" - local servicePid=$(supervisorctl pid "${serviceName}:${serviceName}d") - - if [[ -z "$servicePid" ]] || [[ "$servicePid" == "0" ]]; then - echo "not running" - exit 1 - fi - - echo $servicePid -} - -# Param check -if [ "$#" -lt 2 ]; then - echo "[ERROR] Missing parameters" - serviceHelp - exit 1 -fi - -############################# -# Param init -############################# - -SERVICENAME="$1" -ACTION="$2" - -############################# -# Service aliases -############################# -case "$SERVICENAME" in - apache2|httpd) - SERVICENAME="apache" - ;; -esac - -############################# -# Action runner -############################# -case "$ACTION" in - stop|start|restart|status) - exec supervisorctl "$ACTION" "${SERVICENAME}:${SERVICENAME}d" - ;; - - pid) - echo $(getServicePid "${SERVICENAME}") - ;; - - check) - FIRST_PID=$(getServicePid "${SERVICENAME}") - sleep 5 - SECOND_PID=$(getServicePid "${SERVICENAME}") - - if [[ "$FIRST_PID" == "$SECOND_PID" ]]; then - echo "ok" - exit 0 - else - echo "not running" - exit 1 - fi - ;; - - - *) - echo "[ERROR] Invalid action" - serviceHelp - exit 1 - ;; - -esac diff --git a/docker/base/ubuntu-22.04/conf/bin/usr-bin/version-compare b/docker/base/ubuntu-22.04/conf/bin/usr-bin/version-compare deleted file mode 100644 index ca450b0e9..000000000 --- a/docker/base/ubuntu-22.04/conf/bin/usr-bin/version-compare +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -function versionCompare () { - if [[ $1 == $2 ]] - then - echo -n '=' - return - fi - local IFS=. - local i ver1=($1) ver2=($2) - # fill empty fields in ver1 with zeros - for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) - do - ver1[i]=0 - done - for ((i=0; i<${#ver1[@]}; i++)) - do - if [[ -z ${ver2[i]} ]] - then - # fill empty fields in ver2 with zeros - ver2[i]=0 - fi - if ((10#${ver1[i]} > 10#${ver2[i]})) - then - echo -n '>' - return - fi - if ((10#${ver1[i]} < 10#${ver2[i]})) - then - echo -n '<' - return - fi - done - - echo -n '=' -} - -versionCompare "$1" "$2" diff --git a/docker/base/ubuntu-22.04/conf/etc/cron/.gitkeep b/docker/base/ubuntu-22.04/conf/etc/cron/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/base/ubuntu-22.04/conf/etc/logrotate.d/syslog-ng b/docker/base/ubuntu-22.04/conf/etc/logrotate.d/syslog-ng deleted file mode 100644 index 4a6f9c54e..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/logrotate.d/syslog-ng +++ /dev/null @@ -1,38 +0,0 @@ -/var/log/syslog -{ - rotate 7 - daily - missingok - notifempty - delaycompress - compress - postrotate - /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` > /dev/null - endscript -} - -/var/log/mail.info -/var/log/mail.warn -/var/log/mail.err -/var/log/mail.log -/var/log/daemon.log -/var/log/kern.log -/var/log/auth.log -/var/log/user.log -/var/log/lpr.log -/var/log/cron.log -/var/log/debug -/var/log/messages -{ - rotate 4 - weekly - missingok - notifempty - compress - delaycompress - sharedscripts - postrotate - /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` > /dev/null - supervisorctl restart syslog-ng-stdout > /dev/null - endscript -} \ No newline at end of file diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.conf b/docker/base/ubuntu-22.04/conf/etc/supervisor.conf deleted file mode 100644 index 479e0db08..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/supervisor.conf +++ /dev/null @@ -1,20 +0,0 @@ -[supervisord] -nodaemon=true - -[unix_http_server] -file = /.supervisor.sock -chmod = 0700 -chown = root:root -username = root -password = {SHA}e982f17bcbe0f724063b708a4f76db211a999304 - -[supervisorctl] -serverurl = unix:///.supervisor.sock -username = root -password = docker - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[include] -files = /opt/docker/etc/supervisor.d/*.conf diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/.gitkeep b/docker/base/ubuntu-22.04/conf/etc/supervisor.d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/cron.conf b/docker/base/ubuntu-22.04/conf/etc/supervisor.d/cron.conf deleted file mode 100644 index ef0a71678..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/cron.conf +++ /dev/null @@ -1,14 +0,0 @@ -[group:cron] -programs=crond -priority=25 - -[program:crond] -command = /opt/docker/bin/service.d/cron.sh -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/dnsmasq.conf b/docker/base/ubuntu-22.04/conf/etc/supervisor.d/dnsmasq.conf deleted file mode 100644 index 9832ffca7..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/dnsmasq.conf +++ /dev/null @@ -1,14 +0,0 @@ -[group:dnsmasq] -programs=dnsmasqd -priority=15 - -[program:dnsmasqd] -command = /opt/docker/bin/service.d/dnsmasq.sh -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/postfix.conf b/docker/base/ubuntu-22.04/conf/etc/supervisor.d/postfix.conf deleted file mode 100644 index 9e26baaa2..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/postfix.conf +++ /dev/null @@ -1,17 +0,0 @@ -[group:postfix] -programs=postfixd -priority=30 - -[program:postfixd] -directory = /etc/postfix -command = /opt/docker/bin/service.d/postfix.sh -process_name=%(program_name)s -; postfix.sh runs as long as Postfix does; if it ends sooner, Postfix did not start, and after startretries -; attempts supervisord gives up -startsecs = 5 -autostart = false -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/ssh.conf b/docker/base/ubuntu-22.04/conf/etc/supervisor.d/ssh.conf deleted file mode 100644 index 0ecd798d6..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/ssh.conf +++ /dev/null @@ -1,14 +0,0 @@ -[group:ssh] -programs=sshd -priority=30 - -[program:sshd] -command = /opt/docker/bin/service.d/ssh.sh -process_name=%(program_name)s -startsecs=0 -autostart = false -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/syslog.conf b/docker/base/ubuntu-22.04/conf/etc/supervisor.d/syslog.conf deleted file mode 100644 index 20d1e238c..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/supervisor.d/syslog.conf +++ /dev/null @@ -1,13 +0,0 @@ -[group:syslog] -programs=syslogd -priority=10 - -[program:syslogd] -command = /opt/docker/bin/service.d/syslog-ng.sh -process_name=%(program_name)s -autostart = false -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-22.04/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/ubuntu-22.04/conf/etc/syslog-ng/syslog-ng.conf deleted file mode 100644 index 36fcb09c9..000000000 --- a/docker/base/ubuntu-22.04/conf/etc/syslog-ng/syslog-ng.conf +++ /dev/null @@ -1,49 +0,0 @@ -@version: 3.5 - -template t_isostamp { - # syslog-t_isostamp START - template("[SYSLOG] $MSGHDR$MSG\n"); - # syslog-t_isostamp END -}; - -options { - # syslog-options START - file-template(t_isostamp); - chain_hostnames(off); - flush_lines(0); - use-dns(no); - use_fqdn(no); - owner("root"); - group("adm"); - perm(0640); - stats_freq(0); - # syslog-options START -}; - -source s_src { - # syslog-s_src START - # a datagram socket: syslog() of glibc tries datagrams first, the one of musl on Alpine only sends datagrams - unix-dgram("/dev/log"); - internal(); - # syslog-s_src END -}; - -filter f_filter { - # syslog-f_filter START - not facility(auth, authpriv); - # syslog-f_filter END -}; - -destination d_all { - # syslog-d_all START - pipe("/docker.stdout"); - # syslog-d_all END -}; - -log { - # syslog-log START - source(s_src); - filter(f_filter); - destination(d_all); - # syslog-log START -}; diff --git a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/.gitkeep b/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-entrypoint.sh b/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-entrypoint.sh deleted file mode 100644 index 413e7b37c..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Link main entrypoint script to /entrypoint -ln -sf /opt/docker/bin/entrypoint.sh /entrypoint - -# Link entrypoint cmd shortcut conf directory to /entrypoint.cmd -ln -sf /opt/docker/bin/entrypoint.d /entrypoint.cmd - -# Create /entrypoint.d -mkdir -p /entrypoint.d -chmod 700 /entrypoint.d -chown root:root /entrypoint.d - - diff --git a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-permissions.sh b/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-permissions.sh deleted file mode 100644 index 20d602bdd..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-permissions.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash - diff --git a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-supervisor.sh b/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-supervisor.sh deleted file mode 100644 index 311daee4c..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/10-supervisor.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Remove /usr/sbin/service (images have custom service script) -rm -rf /usr/sbin/service - -# Remove existing supervisor configuration -rm -rf -- /etc/supervisor* - -# Link supervisor configuration script -ln -sf /opt/docker/etc/supervisor.conf /etc/supervisord.conf diff --git a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/90-cleanup.sh b/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/90-cleanup.sh deleted file mode 100644 index 3ca393da6..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/bootstrap.d/90-cleanup.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# Remove default cronjobs -rm -f -- \ - /etc/cron.daily/logrotate \ - /etc/cron.daily/apt-compat \ - /etc/cron.daily/dpkg \ - /etc/cron.daily/passwd \ - /etc/cron.daily/0yum-daily.cron \ - /etc/cron.daily/logrotate \ - /etc/cron.hourly/0yum-hourly.cron \ - /etc/periodic/daily/logrotate diff --git a/docker/base/ubuntu-22.04/conf/provision/build.d/.gitkeep b/docker/base/ubuntu-22.04/conf/provision/build.d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/base/ubuntu-22.04/conf/provision/build.d/10-cleanup.sh b/docker/base/ubuntu-22.04/conf/provision/build.d/10-cleanup.sh deleted file mode 100644 index 41031b784..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/build.d/10-cleanup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -## remove logs (each bootstrap) -rm -rf -- /var/log/* -rm -rf -- /var/tmp/* -rm -rf -- /tmp/* -rm -rf -- /root/.profile diff --git a/docker/base/ubuntu-22.04/conf/provision/entrypoint.d/.gitkeep b/docker/base/ubuntu-22.04/conf/provision/entrypoint.d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/base/ubuntu-22.04/conf/provision/entrypoint.d/05-permissions.sh b/docker/base/ubuntu-22.04/conf/provision/entrypoint.d/05-permissions.sh deleted file mode 100644 index 6f77d8e40..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/entrypoint.d/05-permissions.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Fix rights of /tmp (can be a volume) -chmod 1777 /tmp diff --git a/docker/base/ubuntu-22.04/conf/provision/service.d/.gitkeep b/docker/base/ubuntu-22.04/conf/provision/service.d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/docker/base/ubuntu-22.04/conf/provision/service.d/cron.sh b/docker/base/ubuntu-22.04/conf/provision/service.d/cron.sh deleted file mode 100644 index bd3c79fa5..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/service.d/cron.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -IMAGE_FAMILY=$(docker-image-info family) - -case "$IMAGE_FAMILY" in - Debian|Ubuntu) - apt-install cron - ;; -esac diff --git a/docker/base/ubuntu-22.04/conf/provision/service.d/dnsmasq.sh b/docker/base/ubuntu-22.04/conf/provision/service.d/dnsmasq.sh deleted file mode 100644 index 2925c14ae..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/service.d/dnsmasq.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -IMAGE_FAMILY=$(docker-image-info family) - -# Installation -case "$IMAGE_FAMILY" in - Debian|Ubuntu) - apt-install dnsmasq - ;; - - Alpine) - apk-install dnsmasq - ;; -esac - -# Configuration -go-replace --mode=line \ - -s '^[\s]*user[\s]*=' -r 'user = root' \ - -s '^[\s]*conf-dir[\s]*=' -r 'conf-dir = /etc/dnsmasq.d' \ - -- /etc/dnsmasq.conf diff --git a/docker/base/ubuntu-22.04/conf/provision/service.d/postfix.sh b/docker/base/ubuntu-22.04/conf/provision/service.d/postfix.sh deleted file mode 100644 index b76dfeb0f..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/service.d/postfix.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -IMAGE_FAMILY=$(docker-image-info family) - -# Installation -case "$IMAGE_FAMILY" in - Debian|Ubuntu) - apt-install postfix - ;; - - Alpine) - apk-install postfix - ;; -esac - -# Configuration -go-replace --mode=line \ - -s '^[\s]*mydestination[\s]*=' -r 'mydestination = ' \ - -s '^[\s]*message_size_limit[\s]*=' -r 'message_size_limit = 15240000' \ - -s '^[\s]*smtp_use_tls[\s]*=' -r 'smtp_use_tls = yes' \ - -s '^[\s]*smtp_tls_security_level[\s]*=' -r 'smtp_tls_security_level = may' \ - -s '^[\s]*myhostname[\s]*=' -r '# myhostname' \ - -- /etc/postfix/main.cf diff --git a/docker/base/ubuntu-22.04/conf/provision/service.d/ssh.sh b/docker/base/ubuntu-22.04/conf/provision/service.d/ssh.sh deleted file mode 100644 index 651970290..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/service.d/ssh.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -IMAGE_FAMILY=$(docker-image-info family) - -case "$IMAGE_FAMILY" in - Debian|Ubuntu) - apt-install openssh-server - ;; - - Alpine) - apk-install openssh - ;; -esac diff --git a/docker/base/ubuntu-22.04/conf/provision/service.d/syslog.sh b/docker/base/ubuntu-22.04/conf/provision/service.d/syslog.sh deleted file mode 100644 index 5e63acae5..000000000 --- a/docker/base/ubuntu-22.04/conf/provision/service.d/syslog.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -IMAGE_FAMILY=$(docker-image-info family) - -# Installation -case "$IMAGE_FAMILY" in - Debian|Ubuntu) - apt-install syslog-ng syslog-ng-core - ;; - - Alpine) - apk-install syslog-ng - ;; -esac - -## Configuration -SYSLOG_NG_VERSION=$(syslog-ng --version | grep -E -e '^Installer-Version:[ ]+[0-9]+\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d .) - -# Disable caps inside container -if [[ -f /etc/default/syslog-ng ]]; then - go-replace --mode=lineinfile \ - -s "SYSLOGNG_OPTS" -r "SYSLOGNG_OPTS = --no-caps" \ - -- /etc/default/syslog-ng -fi - -# Symlink configuration -ln -s -f /opt/docker/etc/syslog-ng/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf - -go-replace --mode=lineinfile \ - -s "@version" -r "@version: ${SYSLOG_NG_VERSION}" \ - -- /etc/syslog-ng/syslog-ng.conf - -# Ensure /var/lib/syslog-ng exists -mkdir -p /var/lib/syslog-ng diff --git a/docker/bootstrap/ubuntu-22.04/Dockerfile b/docker/bootstrap/ubuntu-22.04/Dockerfile deleted file mode 100644 index ab0c44fa7..000000000 --- a/docker/bootstrap/ubuntu-22.04/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -#+++++++++++++++++++++++++++++++++++++++ -# Dockerfile for webdevops/bootstrap:ubuntu-22.04 -# -- automatically generated -- -#+++++++++++++++++++++++++++++++++++++++ - - -FROM ubuntu:22.04 - -LABEL maintainer=info@webdevops.io \ - vendor=WebDevOps.io \ - io.webdevops.layout=8 \ - io.webdevops.version=1.5.0 - -ENV TERM="xterm" \ - LANG="C.UTF-8" \ - LC_ALL="C.UTF-8" - - -# Baselayout copy (from staged image) -COPY --from=webdevops/toolbox /baselayout/sbin/* /sbin/ -COPY --from=webdevops/toolbox /baselayout/usr/local/bin/* /usr/local/bin/ - - -RUN set -x \ - # Init bootstrap - && apt-update \ - # System update - && /usr/local/bin/apt-upgrade \ - # Install base stuff - && apt-install \ - ca-certificates \ - apt-transport-https \ - && apt-add-repository multiverse \ - && apt-update \ - && /usr/local/bin/generate-dockerimage-info \ - && docker-run-bootstrap \ - && docker-image-cleanup diff --git a/docker/bootstrap/ubuntu-22.04/Dockerfile.twig b/docker/bootstrap/ubuntu-22.04/Dockerfile.twig deleted file mode 100644 index 44c80d66f..000000000 --- a/docker/bootstrap/ubuntu-22.04/Dockerfile.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% import 'docker.twig' as docker %} -{% import 'provision.twig' as provision %} -{% import 'environment.twig' as environment %} -{% import 'baselayout.twig' as baselayout %} -{% import 'images/bootstrap.twig' as bootstrap %} - -{{ docker.fromOfficial("ubuntu", "22.04") }} - -{{ docker.version() }} - -{{ environment.general() }} - -{{ baselayout.copy() }} - -RUN set -x \ - {{ bootstrap.ubuntu() }} \ - {{ provision.runBootstrap() }} \ - {{ docker.cleanup() }} diff --git a/docker/dockerfile-build-env/latest/Dockerfile b/docker/dockerfile-build-env/latest/Dockerfile deleted file mode 100644 index 8493ea7da..000000000 --- a/docker/dockerfile-build-env/latest/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -#+++++++++++++++++++++++++++++++++++++++ -# Dockerfile for webdevops/dockerfile-build-env:latest -# -- automatically generated -- -#+++++++++++++++++++++++++++++++++++++++ - -FROM webdevops/base-app:ubuntu-22.04 -ARG TARGETARCH - -RUN apt-install \ - gpg-agent \ - apt-transport-https \ - ca-certificates \ - software-properties-common \ - git \ - make \ - && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ - && add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ - && apt-install docker-ce \ - && usermod -aG docker application \ - && docker-image-cleanup - -WORKDIR /app - -CMD ["gosu", "application", "bash"] diff --git a/docker/dockerfile-build-env/latest/Dockerfile.twig b/docker/dockerfile-build-env/latest/Dockerfile.twig deleted file mode 100644 index 76c53c998..000000000 --- a/docker/dockerfile-build-env/latest/Dockerfile.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% import 'docker.twig' as docker %} -{{ docker.from("base-app","ubuntu-22.04") }} -ARG TARGETARCH - -RUN apt-install \ - gpg-agent \ - apt-transport-https \ - ca-certificates \ - software-properties-common \ - git \ - make \ - && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ - && add-apt-repository "deb [arch=$TARGETARCH] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ - && apt-install docker-ce \ - && usermod -aG docker application \ - {{ docker.cleanup() }} - -WORKDIR /app - -CMD ["gosu", "application", "bash"] diff --git a/docs/README.md b/docs/README.md index 7a648dc70..4fed0624d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,11 +9,9 @@ Documentation for the `webdevops/*` Docker images. It describes the images as th | [`webdevops/php`, `webdevops/php-dev`](images/php.md) | PHP-FPM | | [`webdevops/php-nginx`, `webdevops/php-nginx-dev`](images/php-nginx.md) | PHP-FPM with Nginx | | [`webdevops/php-apache`, `webdevops/php-apache-dev`](images/php-apache.md) | PHP-FPM with Apache | -| [`webdevops/bootstrap`, `webdevops/base`, `webdevops/base-app`](images/base.md) | Base images for your own images | -| `webdevops/toolbox` | Build helper, not meant to run. Stores the baselayout scripts (`apt-install`, `apk-install`, `docker-image-cleanup`, `docker-run-bootstrap`, `generate-locales` and more), `go-replace` and `gosu` under `/baselayout`. `bootstrap` and `php` copy them from there with `COPY --from=webdevops/toolbox`. In `toolbox` itself only `go-replace` is on the `PATH`. | -| `webdevops/dockerfile-build-env` | Build environment for this repository, based on `base-app:ubuntu-22.04`. The CI builds and tests the images in it, see [Building in CI](../CONTRIBUTING.md#building-in-ci). | +| `webdevops/toolbox` | Build helper, not meant to run. Stores the baselayout scripts (`apt-install`, `apk-install`, `docker-image-cleanup`, `docker-run-bootstrap`, `generate-locales` and more), `go-replace` and `gosu` under `/baselayout`. `php` copies them from there with `COPY --from=webdevops/toolbox`. In `toolbox` itself only `go-replace` is on the `PATH`. | -`webdevops/nginx`, `webdevops/apache`, the `alpine` tags of `webdevops/bootstrap`, `webdevops/base` and `webdevops/base-app`, as well as `webdevops/storage`, `webdevops/vsftp` and `webdevops/ssh` are no longer built, and `webdevops/php-official` is deprecated. [Replacing discontinued images](discontinued-images.md) shows what to use instead. +`webdevops/bootstrap`, `webdevops/base`, `webdevops/base-app`, `webdevops/dockerfile-build-env`, `webdevops/nginx`, `webdevops/apache`, `webdevops/storage`, `webdevops/vsftp` and `webdevops/ssh` are no longer built, and `webdevops/php-official` is deprecated. [Replacing discontinued images](discontinued-images.md) shows what to use instead. ## Platforms and updates @@ -36,15 +34,12 @@ Documentation for the `webdevops/*` Docker images. It describes the images as th - [Customization](customization.md): commands, scripts at start and build time, tools for your Dockerfile, services, cron jobs, healthcheck, configuration files, locales, the application user - PHP images: [PHP extensions per tag](images/php.md#php-extensions), [Debian or Alpine](images/php.md#debian-or-alpine), [production](images/php.md#production), [installing more extensions](images/php.md#installing-more-extensions), [mail](images/php.md#mail), [Xdebug with an IDE](images/php.md#xdebug-with-an-ide) - [Known issues](known-issues.md): options that do not work, workarounds, migration from older images -- [Replacing discontinued images](discontinued-images.md): what to use instead of `php-official`, `nginx`, `apache`, the `alpine` tags of the base images, `storage`, `vsftp` and `ssh` +- [Replacing discontinued images](discontinued-images.md): what to use instead of `php-official`, `bootstrap`, `base`, `base-app`, `dockerfile-build-env`, `nginx`, `apache`, `storage`, `vsftp` and `ssh` ## How the images build on each other ```mermaid flowchart LR - ubuntu["ubuntu:22.04"] --> bootstrap["webdevops/bootstrap"] - bootstrap --> base["webdevops/base"] - base --> baseapp["webdevops/base-app"] officialphp["php:VERSION-fpm-bookworm / php:8.6-fpm-trixie / php:VERSION-fpm-alpine"] --> php["webdevops/php"] php --> phpdev["webdevops/php-dev"] php --> phpnginx["webdevops/php-nginx"] @@ -52,7 +47,5 @@ flowchart LR phpnginx --> phpnginxdev["webdevops/php-nginx-dev"] phpapache --> phpapachedev["webdevops/php-apache-dev"] alpine["alpine:latest"] --> toolbox["webdevops/toolbox"] - baseapp --> buildenv["webdevops/dockerfile-build-env"] - toolbox -. "COPY --from" .-> bootstrap toolbox -. "COPY --from" .-> php ``` diff --git a/docs/customization.md b/docs/customization.md index 34a00dfec..3cd24f5d5 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -1,6 +1,6 @@ # Customization -All images except `bootstrap` and `toolbox` share the same entrypoint (`/entrypoint`), service handling and hooks. This page describes them. +All images except `toolbox` share the same entrypoint (`/entrypoint`), service handling and hooks. This page describes them. ## Commands @@ -11,7 +11,7 @@ The first argument of the container command selects what the entrypoint does: | `supervisord` | Default command. Starts `supervisord`, which runs all enabled [services](#services). | | `noop` | Keeps the container running without starting services (`tail -f /dev/null`). | | `root` | Runs the remaining arguments as `root`; without arguments it opens `bash`. | -| `cli` | Runs `CLI_SCRIPT` as `APPLICATION_USER` (default `application`); the remaining arguments are passed on. In `base`, which has neither `APPLICATION_USER` nor the user `application`, it runs `CLI_SCRIPT` as `root`. Without `CLI_SCRIPT` it fails with an error. | +| `cli` | Runs `CLI_SCRIPT` as `APPLICATION_USER` (default `application`); the remaining arguments are passed on. Without `CLI_SCRIPT` it fails with an error. | | anything else (`default`) | Runs the command as given, as `root`. | ```yaml @@ -67,16 +67,16 @@ These commands are installed in the images. Use them in `RUN` lines of your own | Command | What it does | Images | | --- | --- | --- | -| `apt-install ` | Runs `apt-get update`, installs the packages without recommended packages and removes the package lists again | Debian- and Ubuntu-based images, including `bootstrap:ubuntu-22.04` | +| `apt-install ` | Runs `apt-get update`, installs the packages without recommended packages and removes the package lists again | Debian-based images, the `php-*` images without `-alpine` | | `apk-install ` | Installs packages with `apk add --no-cache` | Alpine-based images, the `php-*` images with an `-alpine` tag | | `docker-php-setting [--raw] ` | Appends a PHP setting to `/opt/docker/etc/php/php.ini`, for example `docker-php-setting memory_limit 384M`. PHP and PHP-FPM read that file after the [PHP variables](environment-variables.md#php), so the setting wins over them. A value that is not a number is written in quotes; `--raw` writes it as it is, for example `docker-php-setting --raw error_reporting E_ERROR` | `php-*` | | `docker-image-cleanup` | Removes package lists and caches; use it at the end of a `RUN` that installed packages | all except `toolbox` | | `file ` | Shows the type of a file, for example `file --mime-type upload.bin`; tools such as GrumPHP's BOM check call it | `php`, `php-apache`, `php-nginx` and their `-dev` images | | `go-replace -s -r -- ` | Replaces text in files; the same tool fills the [placeholders](#placeholders) | all | | `gosu ` | Runs a command as another user, for example `application` | all except `toolbox` | -| `docker-service enable `, `docker-service disable `, also `docker-service-enable` and `docker-service-disable` | Enables or disables a [service](#services); enabling installs it if needed | all except `bootstrap` and `toolbox` | -| `docker-healthcheck` | Checks the services of supervisord and fails when one failed, see [Healthcheck](#healthcheck) | all except `bootstrap` and `toolbox` | -| `docker-cronjob ''` | Adds a [cron job](#cron-jobs) | all except `bootstrap` and `toolbox` | +| `docker-service enable `, `docker-service disable `, also `docker-service-enable` and `docker-service-disable` | Enables or disables a [service](#services); enabling installs it if needed | all except `toolbox` | +| `docker-healthcheck` | Checks the services of supervisord and fails when one failed, see [Healthcheck](#healthcheck) | all except `toolbox` | +| `docker-cronjob ''` | Adds a [cron job](#cron-jobs) | all except `toolbox` | | `docker-run-bootstrap` | Runs the [build scripts](#scripts-at-image-build) once and deletes them | all except `toolbox` | `apt-install` and `apk-install` are both present in every image except `toolbox`, but each only works on its own distribution. `toolbox` only stores the commands for the other images, see [Images](README.md#images). @@ -113,7 +113,6 @@ go-replace -s '' -r "$API_URL" -- /app/config/app.ini | --- | --- | --- | | `php`, `php-nginx`, `php-apache` | `php-fpm`, `cron`, `syslog`, plus `nginx` or `apache` | `postfix`, `ssh`, `dnsmasq` | | `php-dev`, `php-nginx-dev`, `php-apache-dev` | as above, plus `postfix` and `ssh` | `dnsmasq`; `blackfire-agent`, which `PHP_DEBUGGER=blackfire` starts with the server credentials, see [Development images](environment-variables.md#development-images) | -| `base`, `base-app` | none | `cron`, `syslog`, `postfix`, `ssh`, `dnsmasq` | Enable or disable a service with `docker-service` (or the shortcuts `docker-service-enable` and `docker-service-disable`). If the service's program is not installed yet, enabling it installs it. Do this in your Dockerfile: @@ -153,11 +152,9 @@ FROM webdevops/php:8.5 RUN docker-cronjob '*/5 * * * * application /usr/local/bin/php /app/bin/console app:cleanup' ``` -In the Debian- and Ubuntu-based images, `docker-cronjob` adds the lines to `/etc/cron.d/webdevops-docker`. Alpine's BusyBox `crond` does not read `/etc/cron.d`, but one crontab per user in `/etc/crontabs`, without the user column, so in the Alpine images `docker-cronjob` adds each line without its user to the crontab of that user, for example `/etc/crontabs/application`. There it fails on a line that is not a job with time, user and command, for example a comment or a variable such as `MAILTO=`, and on a user that does not exist. +In the Debian-based images, `docker-cronjob` adds the lines to `/etc/cron.d/webdevops-docker`. Alpine's BusyBox `crond` does not read `/etc/cron.d`, but one crontab per user in `/etc/crontabs`, without the user column, so in the Alpine images `docker-cronjob` adds each line without its user to the crontab of that user, for example `/etc/crontabs/application`. There it fails on a line that is not a job with time, user and command, for example a comment or a variable such as `MAILTO=`, and on a user that does not exist. -Cron in Debian and Ubuntu runs jobs with `PATH=/usr/bin:/bin`, which does not contain `/usr/local/bin`, so use absolute paths such as `/usr/local/bin/php`. Absolute paths work in Alpine too, whose `crond` passes on the `PATH` of the container. - -In `base` and `base-app`, cron does not run by default; also run `docker-service enable cron`, see [Services](#services). +Cron in Debian runs jobs with `PATH=/usr/bin:/bin`, which does not contain `/usr/local/bin`, so use absolute paths such as `/usr/local/bin/php`. Absolute paths work in Alpine too, whose `crond` passes on the `PATH` of the container. ### Time zone @@ -172,11 +169,11 @@ services: PHP_DATE_TIMEZONE: Europe/Berlin ``` -This works in all images, based on Debian, Ubuntu or Alpine. +This works in all images, based on Debian or Alpine. ## Healthcheck -`docker-healthcheck` checks the [services](#services) of supervisord. It fails when a service failed: supervisord gave up on it (`FATAL`), is restarting it after a failed start (`BACKOFF`) or does not know its state (`UNKNOWN`), or supervisord does not answer. It prints the lines of those services. Services that run, start, are not enabled or were stopped do not count. All images except `bootstrap` and `toolbox` have the command. +`docker-healthcheck` checks the [services](#services) of supervisord. It fails when a service failed: supervisord gave up on it (`FATAL`), is restarting it after a failed start (`BACKOFF`) or does not know its state (`UNKNOWN`), or supervisord does not answer. It prints the lines of those services. Services that run, start, are not enabled or were stopped do not count. All images except `toolbox` have the command. Each failed check also writes its reason to the container log, so `docker compose logs` shows it, for example `docker-healthcheck: unhealthy: postfix:postfixd FATAL Exited too quickly (process log may have details)`. The first check that passes after it writes `docker-healthcheck: healthy again` there. Run it as root, as Docker does for the `HEALTHCHECK` of these images: supervisord answers only root, so as another user the check fails with `supervisord does not answer`. @@ -330,7 +327,7 @@ PHP-FPM reads the `*.conf` files in `fpm/pool.d/` in the order of their names: ` ### supervisord -All images except `bootstrap` and `toolbox`. +All images except `toolbox`. | File | Content | | --- | --- | @@ -348,15 +345,14 @@ docker compose exec app supervisorctl restart nginx:nginxd | Image | Locales | | --- | --- | -| `base-app:ubuntu-22.04` and the Debian-based `php-*` images | several hundred locales, for example `de_DE.utf8` and `en_US.utf8` | -| `base:ubuntu-22.04` | only `C`, `C.utf8` and `POSIX` | +| Debian-based `php-*` images | several hundred locales, for example `de_DE.utf8` and `en_US.utf8` | | Alpine-based images | none; they have no `locale` command | List them with `docker compose exec app locale -a`. ## Application user -Images based on `base-app`, and all `php-*` images, contain the user and group `application` (UID and GID `1000`) and the directory `/app`, owned by that user. PHP-FPM runs as `application`. +All `php-*` images contain the user and group `application` (UID and GID `1000`) and the directory `/app`, owned by that user. PHP-FPM runs as `application`. `docker compose exec` runs commands as `root`. Files they create belong to `root`, on the host too when `/app` is mounted from there. Run commands that write files as `application`: diff --git a/docs/discontinued-images.md b/docs/discontinued-images.md index aeea07d73..5558428a0 100644 --- a/docs/discontinued-images.md +++ b/docs/discontinued-images.md @@ -1,6 +1,6 @@ # Replacing discontinued images -`webdevops/nginx`, `webdevops/apache`, the `alpine` tags of `webdevops/bootstrap`, `webdevops/base` and `webdevops/base-app`, as well as `webdevops/storage`, `webdevops/vsftp` and `webdevops/ssh` are no longer built. Their last images stay on Docker Hub, but they get no updates, including security fixes. `webdevops/php-official` is deprecated and gets no new tags. This page shows a replacement for each. The examples are a starting point, not a complete migration. They use the `latest` tag of other projects' images; for production, pin a version or digest, see [Platforms and updates](README.md#platforms-and-updates). +`webdevops/nginx`, `webdevops/apache`, `webdevops/bootstrap`, `webdevops/base`, `webdevops/base-app`, `webdevops/dockerfile-build-env`, `webdevops/storage`, `webdevops/vsftp` and `webdevops/ssh` are no longer built. Their last images stay on Docker Hub, but they get no updates, including security fixes. `webdevops/php-official` is deprecated and gets no new tags. This page shows a replacement for each. The examples are a starting point, not a complete migration. They use the `latest` tag of other projects' images; for production, pin a version or digest, see [Platforms and updates](README.md#platforms-and-updates). ## webdevops/php-official @@ -91,19 +91,39 @@ services: | hooks in `/opt/docker/bin/service.d/httpd.d/` | none; change the configuration in your Dockerfile or mount a configuration file | | `LOG_STDOUT`, `LOG_STDERR` | not needed; the access and error logs go to the stdout and stderr of the container | -## Alpine tags of bootstrap, base and base-app +## webdevops/bootstrap, webdevops/base and webdevops/base-app -The `alpine` tags of `webdevops/bootstrap`, `webdevops/base` and `webdevops/base-app` were last built on Alpine 3.24. The `ubuntu-22.04` tags (also `latest`) are still built, see [webdevops/bootstrap, webdevops/base and webdevops/base-app](images/base.md). +`webdevops/bootstrap`, `webdevops/base` and `webdevops/base-app` were last built on Ubuntu 22.04 (tags `ubuntu-22.04` and `latest`), their `alpine` tags on Alpine 3.24. The PHP images never built on them; they bring the same entrypoint and tools themselves. -For an Alpine image with the same entrypoint, services and tools, build on the Alpine tag of a PHP image. `webdevops/php:8.5-alpine` has `/entrypoint`, `supervisord`, `docker-service`, `docker-run-bootstrap`, `docker-cronjob`, `apk-install`, `go-replace` and `gosu`, and the user `application` with `/app`: +For an image with the entrypoint, the services and the tools of `base` and `base-app`, build on a PHP image. `webdevops/php:8.5` (Debian 12) and `webdevops/php:8.5-alpine` have `/entrypoint`, `supervisord`, `docker-service`, `docker-run-bootstrap`, `docker-cronjob`, `apt-install` (Debian) or `apk-install` (Alpine), `go-replace` and `gosu`, the user `application` with `/app`, and the tools of `base-app`, such as `git`, `rsync` and the SSH client. Unlike `base` and `base-app`, they start PHP-FPM, cron and syslog-ng; disable the services you do not need: ```dockerfile -FROM webdevops/php:8.5-alpine +FROM webdevops/php:8.5 +RUN docker-service disable php-fpm \ + && docker-service disable cron \ + && docker-service disable syslog COPY docker/bootstrap.d/ /bootstrap.d/ RUN docker-run-bootstrap ``` -Without PHP, build on the official [`alpine`](https://hub.docker.com/_/alpine) image instead. +The `cli` command runs `CLI_SCRIPT` as `application` there; `base`, which had no user `application`, ran it as `root`. + +For only the helper scripts of `bootstrap`, such as `apt-install` and `docker-run-bootstrap`, copy them from [`webdevops/toolbox`](https://hub.docker.com/r/webdevops/toolbox) into an official image, as `bootstrap` did: + +```dockerfile +FROM ubuntu:22.04 +COPY --from=webdevops/toolbox /baselayout/sbin/* /sbin/ +COPY --from=webdevops/toolbox /baselayout/usr/local/bin/* /usr/local/bin/ +COPY docker/bootstrap.d/ /bootstrap.d/ +RUN apt-install rsync \ + && docker-run-bootstrap +``` + +`bootstrap` also set `TERM=xterm`, `LANG=C.UTF-8` and `LC_ALL=C.UTF-8`; add them with `ENV` if you need them. + +## webdevops/dockerfile-build-env + +`webdevops/dockerfile-build-env` was the container in which the CI of this repository built and tested the images: `webdevops/base-app:ubuntu-22.04` with Docker, git and make. The CI no longer needs it: its jobs run directly on the GitHub-hosted runners `ubuntu-24.04` and `ubuntu-24.04-arm`, which have Docker, Buildx, git and make. To build and test the images on your own machine, you need Docker, git and make, see [Building and testing locally](../CONTRIBUTING.md#building-and-testing-locally). ## webdevops/storage diff --git a/docs/dockerhub/base-app.md b/docs/dockerhub/base-app.md index 713523a66..87849730d 100644 --- a/docs/dockerhub/base-app.md +++ b/docs/dockerhub/base-app.md @@ -1,32 +1,8 @@ # webdevops/base-app -[`webdevops/base`](https://hub.docker.com/r/webdevops/base) plus the user and group `application` (UID/GID `1000`), `/app` and common tools: `zip`, `unzip`, `bzip2`, `git`, `patch`, `rsync`, the SSH client (`ssh`), a DNS lookup tool (`dig`) and `moreutils`. A base for your own images. +> **This image is no longer built.** The last image is from November 2026. +> It gets no updates, including security fixes. -The `alpine` tag is no longer built, see [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app). +Use [`webdevops/php:8.5`](https://hub.docker.com/r/webdevops/php) instead. How to switch: [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). -Rebuilt every night for linux/amd64 and linux/arm64. - -## Tags - -| Tag | Based on | -| --- | --- | -| `ubuntu-22.04`, `latest` | Ubuntu 22.04 | - -Tags that are not listed here are no longer built and get no updates. - -## Quick start - -```dockerfile -FROM webdevops/base-app:ubuntu-22.04 -COPY docker/bootstrap.d/ /bootstrap.d/ -RUN docker-run-bootstrap -``` - -## Documentation - -- [webdevops/bootstrap, webdevops/base and webdevops/base-app](https://github.com/webdevops/Dockerfile/blob/master/docs/images/base.md) -- [Customization: commands, scripts, services and hooks](https://github.com/webdevops/Dockerfile/blob/master/docs/customization.md) -- [Environment variables](https://github.com/webdevops/Dockerfile/blob/master/docs/environment-variables.md) -- [Known issues](https://github.com/webdevops/Dockerfile/blob/master/docs/known-issues.md) - -Source and issues: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) +Source: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) diff --git a/docs/dockerhub/base.md b/docs/dockerhub/base.md index fd597e108..b6f5ba267 100644 --- a/docs/dockerhub/base.md +++ b/docs/dockerhub/base.md @@ -1,32 +1,8 @@ # webdevops/base -[`webdevops/bootstrap`](https://hub.docker.com/r/webdevops/bootstrap) plus the entrypoint, `supervisord`, service scripts and hooks. A base for your own images. +> **This image is no longer built.** The last image is from November 2026. +> It gets no updates, including security fixes. -The `alpine` tag is no longer built, see [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app). +Use [`webdevops/php:8.5`](https://hub.docker.com/r/webdevops/php) instead. How to switch: [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). -Rebuilt every night for linux/amd64 and linux/arm64. - -## Tags - -| Tag | Based on | -| --- | --- | -| `ubuntu-22.04`, `latest` | Ubuntu 22.04 | - -Tags that are not listed here are no longer built and get no updates. - -## Quick start - -```dockerfile -FROM webdevops/base:ubuntu-22.04 -COPY docker/bootstrap.d/ /bootstrap.d/ -RUN docker-run-bootstrap -``` - -## Documentation - -- [webdevops/bootstrap, webdevops/base and webdevops/base-app](https://github.com/webdevops/Dockerfile/blob/master/docs/images/base.md) -- [Customization: commands, scripts, services and hooks](https://github.com/webdevops/Dockerfile/blob/master/docs/customization.md) -- [Environment variables](https://github.com/webdevops/Dockerfile/blob/master/docs/environment-variables.md) -- [Known issues](https://github.com/webdevops/Dockerfile/blob/master/docs/known-issues.md) - -Source and issues: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) +Source: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) diff --git a/docs/dockerhub/bootstrap.md b/docs/dockerhub/bootstrap.md index 2881c8def..ae6f8cfed 100644 --- a/docs/dockerhub/bootstrap.md +++ b/docs/dockerhub/bootstrap.md @@ -1,31 +1,8 @@ # webdevops/bootstrap -The operating system plus the webdevops helper scripts, for example `docker-run-bootstrap`. A base for your own images and for [`webdevops/base`](https://hub.docker.com/r/webdevops/base). +> **This image is no longer built.** The last image is from November 2026. +> It gets no updates, including security fixes. -The `alpine` tag is no longer built, see [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app). +Use [`ubuntu:22.04`](https://hub.docker.com/_/ubuntu) instead. How to switch: [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). -Rebuilt every night for linux/amd64 and linux/arm64. - -## Tags - -| Tag | Based on | -| --- | --- | -| `ubuntu-22.04`, `latest` | Ubuntu 22.04 | - -Tags that are not listed here are no longer built and get no updates. - -## Quick start - -```dockerfile -FROM webdevops/bootstrap:ubuntu-22.04 -COPY docker/bootstrap.d/ /bootstrap.d/ -RUN docker-run-bootstrap -``` - -## Documentation - -- [webdevops/bootstrap, webdevops/base and webdevops/base-app](https://github.com/webdevops/Dockerfile/blob/master/docs/images/base.md) -- [Scripts at image build](https://github.com/webdevops/Dockerfile/blob/master/docs/customization.md#scripts-at-image-build) -- [Known issues](https://github.com/webdevops/Dockerfile/blob/master/docs/known-issues.md) - -Source and issues: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) +Source: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) diff --git a/docs/dockerhub/dockerfile-build-env.md b/docs/dockerhub/dockerfile-build-env.md index 06f1c3b57..c1d2baf81 100644 --- a/docs/dockerhub/dockerfile-build-env.md +++ b/docs/dockerhub/dockerfile-build-env.md @@ -1,19 +1,6 @@ # webdevops/dockerfile-build-env -Build environment for [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile), based on [`webdevops/base-app`](https://hub.docker.com/r/webdevops/base-app). The CI builds and tests the images in it. +> **This image is no longer built.** The last image is from November 2026. +> It gets no updates, including security fixes. -Rebuilt every night for linux/amd64 and linux/arm64. - -## Tags - -| Tag | Based on | -| --- | --- | -| `latest` | Ubuntu 22.04 | - -Tags that are not listed here are no longer built and get no updates. - -## Documentation - -- [Building in CI](https://github.com/webdevops/Dockerfile/blob/master/CONTRIBUTING.md#building-in-ci) - -Source and issues: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) +Source: [github.com/webdevops/Dockerfile](https://github.com/webdevops/Dockerfile) diff --git a/docs/dockerhub/toolbox.md b/docs/dockerhub/toolbox.md index b669c09cf..2b74ab88d 100644 --- a/docs/dockerhub/toolbox.md +++ b/docs/dockerhub/toolbox.md @@ -1,6 +1,6 @@ # webdevops/toolbox -Build helper, not meant to run. Stores the baselayout scripts (`apt-install`, `apk-install`, `docker-image-cleanup`, `docker-run-bootstrap`, `generate-locales` and more), `go-replace` and `gosu` under `/baselayout`. [`webdevops/bootstrap`](https://hub.docker.com/r/webdevops/bootstrap) and [`webdevops/php`](https://hub.docker.com/r/webdevops/php) copy them from there with `COPY --from=webdevops/toolbox`. In `toolbox` itself only `go-replace` is on the `PATH`. +Build helper, not meant to run. Stores the baselayout scripts (`apt-install`, `apk-install`, `docker-image-cleanup`, `docker-run-bootstrap`, `generate-locales` and more), `go-replace` and `gosu` under `/baselayout`. [`webdevops/php`](https://hub.docker.com/r/webdevops/php) copies them from there with `COPY --from=webdevops/toolbox`, and so can your own images, see [Replacing discontinued images](https://github.com/webdevops/Dockerfile/blob/master/docs/discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). In `toolbox` itself only `go-replace` is on the `PATH`. Rebuilt every night for linux/amd64 and linux/arm64. diff --git a/docs/environment-variables.md b/docs/environment-variables.md index 78a1f8c3e..bc8fba1fb 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -18,7 +18,7 @@ services: ## Application user -Images: `base-app`, `php-*`. +Images: `php-*`. | Variable | Default | Effect | | --- | --- | --- | @@ -30,11 +30,11 @@ Images: `base-app`, `php-*`. ## Container -Images: `base`, `base-app`, `php-*`. +Images: `php-*`. | Variable | Default | Effect | | --- | --- | --- | -| `CLI_SCRIPT` | not set | Command the `cli` entrypoint runs as `APPLICATION_USER`, in `base` as `root`. See [Customization](customization.md#commands). | +| `CLI_SCRIPT` | not set | Command the `cli` entrypoint runs as `APPLICATION_USER`. See [Customization](customization.md#commands). | | `LOG_STDOUT` | container stdout | File that `/docker.stdout` points to. Nginx, Apache and PHP-FPM write their access logs there, syslog-ng the messages of the services, for example of cron and Postfix. | | `LOG_STDERR` | container stderr | File that `/docker.stderr` points to. Nginx and Apache write their error logs there, PHP-FPM its own messages and the errors of the PHP scripts it runs. `php.error_log` gives the PHP errors of PHP-FPM and the PHP CLI a file of their own instead, in a directory that `application` may write to, for example `/app`. | | `TZ` | not set (UTC) | Time zone of the container, for example `Europe/Berlin`. It applies to `date`, cron and the time stamps supervisord writes to the container log. PHP uses `PHP_DATE_TIMEZONE` instead, see [Time zone](customization.md#time-zone). | @@ -182,13 +182,13 @@ Each service reads its options when it starts. A service only runs if it is enab | --- | --- | | `SERVICE_SUPERVISOR_OPTS` | Extra arguments for `supervisord`, for example `--loglevel=debug`. | | `SERVICE_SYSLOG_OPTS` | Extra arguments for `syslog-ng`. | -| `SERVICE_CRON_OPTS` | Extra arguments for `cron -f` (Debian/Ubuntu) or `crond -f` (Alpine). | +| `SERVICE_CRON_OPTS` | Extra arguments for `cron -f` (Debian) or `crond -f` (Alpine). | | `SERVICE_SSH_OPTS` | Extra arguments for `sshd -D`. | | `SERVICE_DNSMASQ_OPTS` | Extra arguments for `dnsmasq`. | | `SERVICE_DNSMASQ_USER` | User `dnsmasq` runs as. Default: `root`. | | `SERVICE_NGINX_OPTS` | Extra arguments for `nginx`, appended after `-g 'daemon off;'`. | | `SERVICE_APACHE_OPTS` | Extra arguments for Apache, for example `-DMYFLAG`. | -| `SERVICE_POSTFIX_OPTS` | Options for the `postfix` command, given before `start`, `stop` and `reload`, for example `-v`: the `postfix` command then logs in more detail while it starts and stops Postfix; the mail daemons keep their log level. The messages reach the container log, on Debian and Ubuntu through syslog. If Postfix does not start, for example because of an unknown option, supervisord gives up after four attempts and the container log shows `postfix start failed`. | +| `SERVICE_POSTFIX_OPTS` | Options for the `postfix` command, given before `start`, `stop` and `reload`, for example `-v`: the `postfix` command then logs in more detail while it starts and stops Postfix; the mail daemons keep their log level. The messages reach the container log, on Debian through syslog. If Postfix does not start, for example because of an unknown option, supervisord gives up after four attempts and the container log shows `postfix start failed`. | | `SERVICE_PHPFPM_OPTS` | Extra arguments for `php-fpm`, for example `-dmax_input_time=120`. | | `SERVICE_BLACKFIRE_AGENT_OPTS` | Extra arguments for `blackfire agent:start`, for example `--socket=tcp://0.0.0.0:8307`. Only in the development images, where the agent runs with `PHP_DEBUGGER=blackfire` and the server credentials, see [Development images](#development-images). If the agent does not start, for example because of an unknown option, supervisord gives up after four attempts. | | `POSTFIX_RELAYHOST` | Postfix `relayhost`, for example `[mail.example.com]:25`. The relay host must accept mail from the container without a login; there is no variable for one. See [Mail](images/php.md#mail). | diff --git a/docs/images/base.md b/docs/images/base.md deleted file mode 100644 index 7b6aa5018..000000000 --- a/docs/images/base.md +++ /dev/null @@ -1,33 +0,0 @@ -# webdevops/bootstrap, webdevops/base and webdevops/base-app - -Base images for your own images and for `webdevops/dockerfile-build-env`. The PHP images do not build on these; they bring the same entrypoint and tools themselves. - -| Image | Adds | -| --- | --- | -| `webdevops/bootstrap` | The operating system plus the webdevops helper scripts, for example `docker-run-bootstrap`. | -| `webdevops/base` | Entrypoint, `supervisord`, service scripts and hooks, see [Customization](../customization.md). | -| `webdevops/base-app` | The user and group `application` (UID/GID `1000`), `/app` and common tools: `zip`, `unzip`, `bzip2`, `git`, `patch`, `rsync`, the SSH client (`ssh`), a DNS lookup tool (`dig`) and `moreutils` (for example `sponge`). | - -## Tags - -| Tag | Based on | -| --- | --- | -| `ubuntu-22.04`, `latest` | `ubuntu:22.04` | - -The `alpine` tags are no longer built, see [Replacing discontinued images](../discontinued-images.md#alpine-tags-of-bootstrap-base-and-base-app). - -The same tags exist for `bootstrap`, `base` and `base-app`. - -## Services - -No service is started by default. `cron`, `syslog`, `postfix`, `ssh` and `dnsmasq` are prepared; `docker-service enable ` installs and enables them, see [Services](../customization.md#services). - -## Usage - -These images are meant as a base for your own images: - -```dockerfile -FROM webdevops/base-app:ubuntu-22.04 -COPY docker/bootstrap.d/ /bootstrap.d/ -RUN docker-run-bootstrap -``` diff --git a/docs/known-issues.md b/docs/known-issues.md index 90d4e8d5c..1fc1f62f1 100644 --- a/docs/known-issues.md +++ b/docs/known-issues.md @@ -7,7 +7,7 @@ These options and tools are part of the images but do not work, or work only in ### `SERVICE_SUPERVISOR_USER` - **Effect:** Any value other than `root` makes the container exit with code 2 right after the start: supervisord switches to that user and then cannot create its control socket `/.supervisor.sock` (`Cannot open an HTTP server: … EACCES`). -- **Images:** all images except `bootstrap` and `toolbox`. +- **Images:** all images except `toolbox`. - **Instead:** Leave it unset. PHP-FPM runs its workers as `application` anyway. ### `latest` and `alpine` tags of the PHP images @@ -33,5 +33,6 @@ These options and tools are part of the images but do not work, or work only in - `XDEBUG_REMOTE_*`, `XDEBUG_IDE_KEY`, `XDEBUG_MAX_NESTING_LEVEL` and `XDEBUG_PROFILER_*` are ignored; they belong to Xdebug 2. Set the Xdebug 3 directive with `php.xdebug.` instead, for example `php.xdebug.max_nesting_level: "500"` or `php.xdebug.idekey: PHPSTORM`. The variables listed under [Development images](environment-variables.md#development-images) still work. - Tags that are no longer built stay on Docker Hub without updates: PHP 5.6 to 8.1 and all operating system tags such as `debian-9` or `ubuntu-18.04`. For `latest` and `alpine`, see [above](#latest-and-alpine-tags-of-the-php-images). - The images `webdevops/nginx` and `webdevops/apache` and the `alpine` tags of `webdevops/bootstrap`, `webdevops/base` and `webdevops/base-app` are no longer built. Their last images, on Alpine 3.24, stay on Docker Hub without updates, and so do the older tags of `nginx` and `apache`, among them `latest` (Ubuntu 18.04 from April 2020). For replacements, see [Replacing discontinued images](discontinued-images.md). +- The images `webdevops/bootstrap`, `webdevops/base` and `webdevops/base-app` are no longer built at all, nor is `webdevops/dockerfile-build-env`. Their last images, on Ubuntu 22.04 (tags `ubuntu-22.04` and `latest`), stay on Docker Hub without updates. Build on `webdevops/php` instead, or copy the helper scripts from `webdevops/toolbox` into an official image, see [Replacing discontinued images](discontinued-images.md#webdevopsbootstrap-webdevopsbase-and-webdevopsbase-app). - The images `webdevops/storage`, `webdevops/vsftp` and `webdevops/ssh` are no longer built. Their last images stay on Docker Hub without updates (`ssh` since December 2022). For replacements, see [Replacing discontinued images](discontinued-images.md). - The Ansible provisioning is removed: `docker-provision`, `docker-ansible-install`, `/opt/docker/bin/provision` and the `provision.role*` commands of `/opt/docker/bin/control.sh`. They needed Python 2 and Ansible packages that no longer exist and did not work in any image. `/opt/docker/provision/onbuild.d` is removed too; scripts in it were never run. Use shell scripts in `bootstrap.d` or `build.d`, see [Scripts at image build](customization.md#scripts-at-image-build). diff --git a/template/Dockerfile/images/base.twig b/template/Dockerfile/images/base.twig index 9de9e69ef..639228450 100644 --- a/template/Dockerfile/images/base.twig +++ b/template/Dockerfile/images/base.twig @@ -25,16 +25,3 @@ tzdata \ && chmod +s /sbin/gosu {%- endmacro %} - -{% macro ubuntu(role='') -%} - # Install services - && chmod +x /opt/docker/bin/* \ - && apt-install \ - supervisor \ - wget \ - curl \ - vim \ - net-tools \ - tzdata \ - && chmod +s /sbin/gosu -{%- endmacro %} diff --git a/template/Dockerfile/images/baseapp.twig b/template/Dockerfile/images/baseapp.twig index 37fcc9053..1fff094a0 100644 --- a/template/Dockerfile/images/baseapp.twig +++ b/template/Dockerfile/images/baseapp.twig @@ -28,20 +28,3 @@ patch \ && /usr/local/bin/generate-locales {%- endmacro %} - -{% macro ubuntu(role='') -%} - # Install services - && apt-install \ - # Install common tools - zip \ - unzip \ - bzip2 \ - moreutils \ - dnsutils \ - openssh-client \ - rsync \ - git \ - patch \ - && mkdir -p /var/lib/syslog-ng/ \ - && /usr/local/bin/generate-locales -{%- endmacro %} diff --git a/template/Dockerfile/images/bootstrap.twig b/template/Dockerfile/images/bootstrap.twig index 91ac82c71..e858d1a6a 100644 --- a/template/Dockerfile/images/bootstrap.twig +++ b/template/Dockerfile/images/bootstrap.twig @@ -31,17 +31,3 @@ locales \ gnupg {%- endmacro %} - -{% macro ubuntu() -%} - # Init bootstrap - && apt-update \ - # System update - && /usr/local/bin/apt-upgrade \ - # Install base stuff - && apt-install \ - ca-certificates \ - apt-transport-https \ - && apt-add-repository multiverse \ - && apt-update \ - && /usr/local/bin/generate-dockerimage-info -{%- endmacro %}