Add cross-arch buildscript

This commit is contained in:
Max
2025-10-13 20:57:37 +02:00
parent 8aae094348
commit eabab653a0
5 changed files with 94 additions and 12 deletions

View File

@@ -22,21 +22,36 @@ Spyder exits when you close the IDE window. Stop the stack with `Ctrl+C`.
## Using a Prebuilt Image
Build the image locally, tag it, and push it to your registry of choice (example: `ghcr.io/your-account/spyder-wayland:latest`).
Publish a multi-arch image to your Gitea container registry, then consumers can pull it directly.
### 1. Configure registry access
```bash
docker compose build
docker tag spyder-conda ghcr.io/your-account/spyder-wayland:latest
docker push ghcr.io/your-account/spyder-wayland:latest
docker login gitea.example.com
```
Consumers can run the IDE without building locally using the provided `compose.runtime.yaml`:
Use your Gitea username and a personal access token with `write:packages` scope.
### 2. Build and push
`build-and-push.sh` wraps `docker buildx` to build Linux/amd64 and Linux/arm64 images and push them to the registry referenced by `SPYDER_IMAGE`.
```bash
chmod +x build-and-push.sh
./build-and-push.sh
```
Adjust `SPYDER_IMAGE`, `BUILDX_PLATFORMS`, or `BUILDX_BUILDER_NAME` in `.env` to control the target registry, platforms, or builder instance.
### 3. Let consumers run the image
Distribute `compose.runtime.yaml` (or the example compose below). End users simply run:
```bash
docker compose -f compose.runtime.yaml up
```
Override the default image by exporting `SPYDER_IMAGE` in `.env`.
Set `SPYDER_IMAGE` in their `.env` file if they host the image under a different name.
## Environment Variables
@@ -45,6 +60,8 @@ Key settings live in `.env`:
- `UID`, `GID`, `HOST_USER`, `HOST_GROUP` mirror the host user to preserve file ownership.
- `SPYDER_HOME`, `SPYDER_WORKSPACE` container paths for the Spyder home and project workspace.
- `SPYDER_HOME_VOLUME`, `SPYDER_WORKSPACE_VOLUME` host-side bind mounts for persistence (can be absolute or relative paths).
- `LOCAL_IMAGE_NAME` tag applied to locally built images via `docker compose build`.
- `SPYDER_IMAGE`, `BUILDX_PLATFORMS`, `BUILDX_BUILDER_NAME` registry target and buildx configuration used by `build-and-push.sh`.
- `XDG_RUNTIME_DIR`, `WAYLAND_DISPLAY`, `DISPLAY` display/socket paths exported from the host session.
- `DEBUG` placeholder for future debug toggles.
@@ -64,7 +81,10 @@ SPYDER_WORKSPACE_VOLUME=./spyder-workspace
XDG_RUNTIME_DIR=/run/user/1000
WAYLAND_DISPLAY=wayland-1
DISPLAY=:0
SPYDER_IMAGE=ghcr.io/your-account/spyder-wayland:latest
LOCAL_IMAGE_NAME=spyder-conda
SPYDER_IMAGE=gitea.example.com/max/spyder-wayland:latest
BUILDX_PLATFORMS=linux/amd64,linux/arm64
BUILDX_BUILDER_NAME=spyder-buildx
DEBUG=0
```