Build multi-platform image for linux/amd64 and linux/arm64
The builder stage cross-compiles Caddy for the target platform, so no emulation is needed. The module check runs against the amd64 image; PR checks also build arm64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -21,11 +21,16 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker buildx
|
||||
run: |
|
||||
docker buildx rm multi 2>/dev/null || true
|
||||
docker buildx create --name multi --driver docker-container --use
|
||||
|
||||
- name: Build
|
||||
run: docker build --pull --tag "$IMAGE:latest" .
|
||||
run: docker buildx build --pull --platform linux/amd64 --tag "$IMAGE:check" --load .
|
||||
|
||||
- name: Check the deSEC module is built in
|
||||
run: docker run --rm "$IMAGE:latest" caddy list-modules | grep -x dns.providers.desec
|
||||
run: docker run --rm "$IMAGE:check" caddy list-modules | grep -x dns.providers.desec
|
||||
|
||||
- name: Log in to the container registry
|
||||
env:
|
||||
@@ -40,5 +45,10 @@ jobs:
|
||||
echo "No existing :latest to promote; skipping."
|
||||
fi
|
||||
|
||||
- name: Push "latest"
|
||||
run: docker push "$IMAGE:latest"
|
||||
- name: Build and push multi-arch "latest"
|
||||
run: |
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--tag "$IMAGE:latest" \
|
||||
--push \
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user