Repository navigation
ci: build e publicação multi-arch das imagens base PHP - #3
Merged
Merged
Conversation
Add a GitHub Actions workflow that builds every base_images/php/Dockerfile-* for linux/amd64 and linux/arm64 on native runners. - Pull requests: build and smoke test (php -v, php -m, composer), no push. - master: push each arch by digest, then merge into a multi-arch manifest tagged latest and YYYYMMDD-<sha>. - Weekly no-cache rebuild so images pick up new PPA security releases. Publishing requires DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repo secrets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
luiztucillo
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexto
Hoje as imagens base (
luiztucillo/phpXX) são publicadas manualmente, e o Docker Hub está desatualizado em relação ao repo:luiztucillo/php85não existe, entãoimages/php/Dockerfile-8.5falha para qualquer pessoa;php84:latesté de 13/06/2025 e as demais são de 2019 a 2025, ou seja, a correção do CVE-2026-109618/109619 (PR fix(php): corrige CVE-2026-109618/109619 nas imagens base e adiciona PHP 8.5 #2) ainda não foi publicada;amd64, então rodam emuladas em Macs Apple Silicon.O que este PR faz
Adiciona o workflow
.github/workflows/base-images.yml, que compila os novebase_images/php/Dockerfile-*(5.6 a 8.5) paralinux/amd64elinux/arm64. Cada arquitetura roda em runner nativo (ubuntu-24.04eubuntu-24.04-arm, gratuitos em repo público), sem QEMU.base_images/**php -v,php -m,composer --version). Sem login e sem push.masterque alterabase_images/**mergecria o manifest multi-arch com as tagslatesteAAAAMMDD-<sha>.workflow_dispatchmaster).A tag
latestmantém osimages/php/Dockerfile-*funcionando sem mudanças. A tag datada permite fixar versão e fazer rollback. O README ganhou uma seção explicando o workflow e o uso dedocker-compose build --pull phppara baixar as imagens novas.O workflow precisa de dois secrets no repositório (secrets, não variables). Sem eles, os PRs funcionam normalmente, mas a publicação no
masterfalha no login.DOCKERHUB_USERNAMEluiztucillo(usuário dono do namespace no Docker Hub)DOCKERHUB_TOKENComo gerar o
DOCKERHUB_TOKENluiztucillo.github-actions docker-php-apps; expiração a critério; Access permissions: Read & Write (Read-only não permite push; Read, Write & Delete não é necessário).Como cadastrar no GitHub
Pela interface: Settings → Secrets and variables → Actions → aba Secrets → New repository secret, uma vez para cada nome da tabela acima.
Ou pela CLI (precisa de permissão de admin no repo):
Como validar
php<versão> linux/<arch>) devem ficar verdes e o jobmergedeve aparecer como skipped.masterpublica as imagens. Para conferir:docker buildx imagetools inspect luiztucillo/php85:latest # deve listar linux/amd64 e linux/arm64master.Observações
mergeaparece como skipped (com o nomephp${{ matrix.php }} manifestsem expandir, porque é pulado antes da matriz ser montada), o que é esperado em PR.luiztucillo/php85automaticamente. Vale conferir se a visibilidade ficou pública, já que ela segue o padrão configurado na conta.buildemerge).🤖 Generated with Claude Code