Skip to content

Commit 63577bb

Browse files
committed
fix: make legacy multi-arch builds reliable
1 parent c179efa commit 63577bb

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,7 @@ for `linux/amd64`, `linux/386`, and `linux/arm/v5`.
7272
- Keep pinned APT installation before local `COPY` instructions.
7373
- Keep shell compatible with Debian Etch's Bash 3 and validate with `bash -n`.
7474
- Preserve Docker Official Image semantics where MySQL 5.0 supports them.
75+
- Treat QEMU execution of `linux/arm/v5` as best effort; Buildx output is
76+
supported, but MySQL's legacy threaded bootstrap requires native validation.
7577
- Use non-interactive cleanup and never commit database dumps.
7678
- Run `make structure` and `make smoke` after runtime changes.

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ FROM debian/eol:etch-slim
33

44
ENV DEBIAN_FRONTEND=noninteractive
55

6-
# Etch APT requires the configuration form of no-install-recommends.
6+
# Etch APT requires the configuration form of no-install-recommends. Divert
7+
# mysqld while dpkg runs its postinst: that script bootstraps a throwaway data
8+
# directory several times, which is both slow under emulation and deleted below.
79
RUN printf '#!/bin/sh\nexit 101\n' > /usr/sbin/policy-rc.d \
810
&& chmod +x /usr/sbin/policy-rc.d \
11+
&& dpkg-divert --add --rename --divert /usr/sbin/mysqld.distrib /usr/sbin/mysqld \
12+
&& printf '#!/bin/sh\nexit 0\n' > /usr/sbin/mysqld \
13+
&& chmod +x /usr/sbin/mysqld \
914
&& apt-get update \
1015
&& apt-get install -y -o APT::Install-Recommends=false \
1116
mysql-server-5.0=5.0.32-7etch12 \
1217
mysql-client-5.0=5.0.32-7etch12 \
18+
&& rm -f /usr/sbin/mysqld \
19+
&& dpkg-divert --rename --remove /usr/sbin/mysqld \
1320
&& apt-get clean \
1421
&& rm -rf /var/lib/apt/lists/* \
1522
/var/cache/apt/archives/*.deb \

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ The image index publishes these Etch-supported platforms:
4343
- `linux/arm/v5`
4444

4545
There is no native `linux/arm64` image. An ARM64 host must explicitly request
46-
and emulate the 32-bit ARM image when its Docker/QEMU setup supports it:
46+
and emulate the 32-bit ARM image when its Docker/QEMU setup supports it.
47+
Buildx can build the artifact, but current user-mode QEMU may fail MySQL 5.0's
48+
threaded bootstrap with `Can't create interrupt-thread`; treat emulated runs as
49+
best effort and validate production use on native compatible ARM32 hardware.
4750

4851
```bash
4952
docker run --rm --platform=linux/arm/v5 \
@@ -167,14 +170,15 @@ make build # Build linux/amd64 by default
167170
make build-all # Build all release platforms into the Buildx cache
168171
make structure # Verify package, config, and image cleanup
169172
make smoke # Verify initialization, TCP auth, init files, and persistence
170-
make smoke-all # Build and smoke all platforms under native/QEMU execution
173+
make smoke-all # Attempt the lifecycle smoke test on every release platform
171174
make run # Run the selected image locally
172175
make shell # Open Bash in the selected image
173176
```
174177

175178
Override `PLATFORM`, `IMAGE`, `VERSION`, `ROOT_PASSWORD`, or `PORT` as needed.
176179
Multi-platform targets require a Buildx builder with the corresponding QEMU
177-
handlers.
180+
handlers. `make smoke-all` fails honestly when the host emulator cannot run an
181+
architecture's MySQL bootstrap; this is a known possibility for `arm/v5`.
178182

179183
## Releases
180184

tests/smoke.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ trap cleanup EXIT
2323

2424
wait_for_mysql() {
2525
local attempt running
26-
for attempt in $(seq 1 120); do
26+
for attempt in $(seq 1 "${MYSQL_WAIT_ATTEMPTS:-120}"); do
2727
running="$(docker inspect --format '{{.State.Running}}' "$CONTAINER" 2>/dev/null || true)"
2828
if [ "$running" != true ]; then
2929
docker logs "$CONTAINER" >&2 || true
@@ -41,6 +41,7 @@ wait_for_mysql() {
4141
query_from_peer() {
4242
docker run --rm --platform="$PLATFORM" --network="$NETWORK" \
4343
--entrypoint mysql "$IMAGE" --protocol=TCP --host=db \
44+
--connect-timeout="${MYSQL_CONNECT_TIMEOUT:-3}" \
4445
--user="$1" --password="$2" --batch --skip-column-names \
4546
--execute="$3"
4647
}

0 commit comments

Comments
 (0)