Add arm64 compose files: one builds the image, one runs the published one
docker-compose.arm64.build.yml builds the image for linux/arm64 from source and tags it for the registry (docker compose ... build, then push); it can also build and run directly on an arm64 machine. Building on x86 works through QEMU, with the one-time binfmt setup noted in the file. docker-compose.arm64.yml runs that published image on the arm64 machine with no build there. Both use the same image name and an :arm64 tag, kept apart from the default image so the existing docker-compose.yml is untouched. IMAGE_REPO and ARM64_TAG (in .env or the shell) switch the registry or pin a release tag. Also adds a .dockerignore, which the repo lacked. The Dockerfile runs COPY . . after npm ci, so a local build from a developer checkout would overwrite the container's node_modules with the host's (Windows/x86 binaries) and break the build -- most visibly when cross-building for arm64. It also keeps .env, data/ and .git out of the build context. libsql's arm64 musl binary is present in package-lock.json, and the Dockerfile's node:22-alpine base is multi-arch. Not built or run: Docker isn't available in this environment, so neither the emulated arm64 build nor the compose files themselves have been executed. The YAML was only checked for whitespace and against the runtime section of docker-compose.yml. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f2b5da7be
commit
07d20bd2b7
5 files changed
+107
No files matched your search
@@ -255,3 +255,27 @@ docker compose up -d
|
||||
|
||||
The app listens on `HOST_PORT` (default `3000`); SQLite data persists in
|
||||
`./data` on the host.
|
||||
|
||||
### arm64 (Raspberry Pi, Apple silicon, ARM servers)
|
||||
|
||||
Two compose files, one to build the image and one to run the published one:
|
||||
|
||||
```bash
|
||||
# On any machine with Docker: build the arm64 image and push it to the registry
|
||||
docker compose -f docker-compose.arm64.build.yml build
|
||||
docker compose -f docker-compose.arm64.build.yml push
|
||||
|
||||
# On the arm64 machine: pull that image and run it (no build there)
|
||||
docker compose -f docker-compose.arm64.yml pull
|
||||
docker compose -f docker-compose.arm64.yml up -d
|
||||
```
|
||||
|
||||
`docker-compose.arm64.build.yml` can also build and run right on an arm64 machine
|
||||
(`up -d --build`). Building on x86 goes through QEMU emulation — slower, and it needs
|
||||
a one-time `docker run --privileged --rm tonistiigi/binfmt --install arm64`.
|
||||
|
||||
Both files use the image `gitea.labsconnect.se/bobban/homelabmanager-homelab-manager:arm64`.
|
||||
Set `IMAGE_REPO` and/or `ARM64_TAG` in `.env` to use another registry or to pin a release
|
||||
tag (e.g. `ARM64_TAG=1.4.0-arm64`). The arm64 tag is kept separate from the default image,
|
||||
so the existing `docker-compose.yml` is unaffected. A `.dockerignore` keeps host
|
||||
`node_modules`, `.env` and `data/` out of the build.
|
||||
Reference in new issue
Block a user