Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/build-php-images/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ runs:
username: ${{ inputs.ghcr_token && inputs.ghcr_user || github.actor }}
password: ${{ inputs.ghcr_user && inputs.ghcr_token || inputs.github_token }}

# QEMU is required only when this runner cannot execute the target
# architecture. Native amd64 and arm64 builds skip it.
- name: Set up QEMU
if: ${{ !(runner.arch == 'X64' && startsWith(inputs.platform, 'linux/amd64')) }}
if: ${{ (runner.arch == 'X64' && !startsWith(inputs.platform, 'linux/amd64')) || (runner.arch == 'ARM64' && !startsWith(inputs.platform, 'linux/arm64')) }}
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Images are published to Docker Hub as `devpanel/php:<version>-<variant>` (e.g. `
```
base/ # Shared base Dockerfile (PHP + Apache)
Dockerfile
bin/ # DevPanel CLI binary
bin/ # devpanel CLI binaries from devpanel/cli, named devpanel-$arch
drush/ # Drush version directories (drush7–drush11)
scripts/ # Apache startup scripts
templates/ # Apache/PHP config templates
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Each PHP version ships three layered variants.

Release candidate tags end with `-rc` (e.g. `8.3-base-rc`).

The bundled legacy `devpanel` CLI is AMD64-only, including in ARM64 images.
Executing it on an ARM64 host requires AMD64 emulation on that host; CI runner
emulation is not included in the published images.
Each image includes the `devpanel` CLI built from
[devpanel/cli](https://github.com/devpanel/cli) for its own architecture
(`base/bin/devpanel-amd64` or `base/bin/devpanel-arm64`).

Available PHP versions: **7.4 · 8.0 · 8.1 · 8.2 · 8.3**

Expand Down Expand Up @@ -184,6 +184,10 @@ removed). To remove all `devpanel-php-test:*` images at once, run:
bash tests/cleanup-test-images.sh
```

The image build copies the committed `base/bin/devpanel-amd64` or
`base/bin/devpanel-arm64` binary from
[devpanel/cli](https://github.com/devpanel/cli).

Build tests take several minutes per PHP version because the images download
packages (code-server, composer, etc.). Run a single version during
development to keep the feedback loop short:
Expand Down Expand Up @@ -286,9 +290,10 @@ for setup instructions.
- The build workflow is `docker-build.yml`, which handles both push-triggered
and manual dispatch builds. It runs a detect → build (per-platform,
parallel) → merge pipeline. ARM64 builds use native `ubuntu-26.04-arm`
runners; AMD64 builds use `ubuntu-26.04`. QEMU is set up on ARM runners
to execute the bundled AMD64 DevPanel CLI, and for cross-platform builds.
Native AMD64 builds skip QEMU.
runners; AMD64 builds use `ubuntu-26.04`. Each image copies the committed
`devpanel` binary for its platform.
QEMU is set up only when the runner architecture differs from that
platform. Native AMD64 and ARM64 builds skip QEMU.
- The `advance` variant depends on `secure`, which depends on `base`.
The build chain is enforced via the bake target dependency graph.

Expand Down
38 changes: 38 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,41 @@ Use this file to track work that needs to be done. Lint scripts automatically ap
- Legacy images use a PEAR release with HTTP chunked response decoding.
- OPcache remains loaded on every PHP version without enabling a nonexistent PHP 8.5 shared module.
- Focused checks pass; any remaining build or CI blockers are explicitly reported.

# Task: Install the platform-matching DevPanel CLI

## Steps
- [x] Copy `base/bin/devpanel-${TARGETARCH}` in the shared image build.
- [x] Download the matching release asset from `devpanel/dp-cli` before publish builds.
- [x] Register QEMU only when the runner architecture differs from the target platform.
- [x] Document the architecture-specific CLI and the native-build QEMU skip.
- [x] Run YAML, shell, and Dockerfile lint; self-test asset selection and the amd64 fallback.

## Definition of Done
- ARM64 image builds install an arm64 `devpanel` binary from `devpanel/dp-cli`.
- Native AMD64 and ARM64 builds do not register QEMU. Cross-architecture builds still do.
- YAML, shell, and Dockerfile lint baselines match, and the changed files contain no secrets.

# Task: Use GHCR_TOKEN for the latest DevPanel CLI

## Steps
- [x] Download the latest `devpanel/dp-cli` release with `GHCR_TOKEN` when that secret is set.
- [x] Remove the release-version input.
- [x] Verify the committed fallback CLIs with `devpanel cli:version`.
- [x] Keep the committed `base/bin/devpanel-amd64` and `devpanel-arm64` binaries when `GHCR_TOKEN` is unset.

## Definition of Done
- Builds with `GHCR_TOKEN` install the latest platform-matching CLI from `devpanel/dp-cli`.
- Builds without that token use the committed fallback binary and `devpanel cli:version` succeeds.
- There is no input for pinning a CLI release.

# Task: Build the DevPanel CLI from devpanel/cli

## Steps
- [x] Confirm the original `base/bin/devpanel` binary is `github.com/devpanel/cli/cmd/devpanel-client`.
- [x] Restore that amd64 binary and stop downloading `devpanel/dp-cli` during image builds.
- [x] Verify the restored amd64 binary with `devpanel version`.

## Definition of Done
- Image builds copy `base/bin/devpanel-$TARGETARCH` and run `devpanel version`.
- The committed amd64 binary is the original `github.com/devpanel/cli` executable.
5 changes: 4 additions & 1 deletion base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ RUN a2enmod rewrite remoteip headers

# Copy shared assets from the 'common' build context (./base/ directory).
# Per-version Dockerfiles may overlay version-specific files on top.
COPY --from=common bin/devpanel /usr/local/bin/devpanel
# devpanel-$TARGETARCH is the CLI for this image, built from
# https://github.com/devpanel/cli (package cmd/devpanel-client).
ARG TARGETARCH
COPY --from=common bin/devpanel-${TARGETARCH} /usr/local/bin/devpanel
RUN chmod +x /usr/local/bin/devpanel && devpanel version
COPY --from=common templates /templates
COPY --from=common scripts /scripts
Expand Down
File renamed without changes.
Loading