mirror of
https://github.com/johndoe6345789/SparkOS.git
synced 2026-04-24 13:34:56 +00:00
Enable multi-architecture Docker builds for arm64 and amd64
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
1
.github/workflows/docker-publish.yml
vendored
1
.github/workflows/docker-publish.yml
vendored
@@ -58,6 +58,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
load: ${{ github.event_name == 'pull_request' }}
|
load: ${{ github.event_name == 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -26,6 +26,7 @@ The current MVP provides:
|
|||||||
- ✅ DNS configuration with public fallback servers
|
- ✅ DNS configuration with public fallback servers
|
||||||
- ✅ Docker container for testing
|
- ✅ Docker container for testing
|
||||||
- ✅ Automated builds and publishing to GHCR
|
- ✅ Automated builds and publishing to GHCR
|
||||||
|
- ✅ Multi-architecture Docker images (AMD64 and ARM64)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -49,19 +50,24 @@ To create bootable images (optional):
|
|||||||
The easiest way to test SparkOS is using the pre-built Docker image from GitHub Container Registry:
|
The easiest way to test SparkOS is using the pre-built Docker image from GitHub Container Registry:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Pull and run the latest image
|
# Pull and run the latest image (automatically selects the correct architecture)
|
||||||
docker pull ghcr.io/johndoe6345789/sparkos:latest
|
docker pull ghcr.io/johndoe6345789/sparkos:latest
|
||||||
docker run --rm ghcr.io/johndoe6345789/sparkos:latest
|
docker run --rm ghcr.io/johndoe6345789/sparkos:latest
|
||||||
|
|
||||||
# Or build locally
|
# Or build locally
|
||||||
docker build -t sparkos:local .
|
docker build -t sparkos:local .
|
||||||
docker run --rm sparkos:local
|
docker run --rm sparkos:local
|
||||||
|
|
||||||
|
# Build for specific architecture
|
||||||
|
docker buildx build --platform linux/amd64 -t sparkos:amd64 --load .
|
||||||
|
docker buildx build --platform linux/arm64 -t sparkos:arm64 --load .
|
||||||
```
|
```
|
||||||
|
|
||||||
The Docker image includes:
|
The Docker image includes:
|
||||||
- Pre-built init system binary
|
- Pre-built init system binary
|
||||||
- Minimal root filesystem structure
|
- Minimal root filesystem structure
|
||||||
- Test environment for validation
|
- Test environment for validation
|
||||||
|
- **Multi-architecture support**: Available for both AMD64 (x86_64) and ARM64 (aarch64) architectures
|
||||||
|
|
||||||
Images are automatically built and published to [GitHub Container Registry](https://github.com/johndoe6345789/SparkOS/pkgs/container/sparkos) on every push to main branch.
|
Images are automatically built and published to [GitHub Container Registry](https://github.com/johndoe6345789/SparkOS/pkgs/container/sparkos) on every push to main branch.
|
||||||
|
|
||||||
@@ -169,17 +175,22 @@ SparkOS uses GitHub Actions for continuous integration and delivery:
|
|||||||
- Docker images are automatically built on every push to main/develop branches
|
- Docker images are automatically built on every push to main/develop branches
|
||||||
- Images are also built for pull requests (testing only, not published)
|
- Images are also built for pull requests (testing only, not published)
|
||||||
- Tagged releases automatically create versioned Docker images
|
- Tagged releases automatically create versioned Docker images
|
||||||
|
- **Multi-architecture builds**: Images are built for both AMD64 (x86_64) and ARM64 (aarch64)
|
||||||
|
|
||||||
**Container Registry:**
|
**Container Registry:**
|
||||||
- Images are published to GitHub Container Registry (GHCR)
|
- Images are published to GitHub Container Registry (GHCR)
|
||||||
- Pull images: `docker pull ghcr.io/johndoe6345789/sparkos:latest`
|
- Pull images: `docker pull ghcr.io/johndoe6345789/sparkos:latest`
|
||||||
- Available tags: `latest`, `main`, `develop`, version tags (e.g., `v1.0.0`)
|
- Available tags: `latest`, `main`, `develop`, version tags (e.g., `v1.0.0`)
|
||||||
|
- Docker will automatically select the correct architecture for your platform
|
||||||
|
|
||||||
**Docker Development:**
|
**Docker Development:**
|
||||||
```bash
|
```bash
|
||||||
# Build Docker image locally
|
# Build Docker image locally
|
||||||
docker build -t sparkos:dev .
|
docker build -t sparkos:dev .
|
||||||
|
|
||||||
|
# Build for multiple architectures (requires Docker Buildx)
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64 -t sparkos:multiarch .
|
||||||
|
|
||||||
# Test the image
|
# Test the image
|
||||||
docker run --rm sparkos:dev
|
docker run --rm sparkos:dev
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user