docker: add Docker image for ARM.
* Have CI build Docker images for both x86 and ARM. * Add a `bin/rails danbooru:docker:build-arm` command for building a Docker image locally for ARM. Usage: * Test the image: docker run --rm -it --platform linux/arm64 ghcr.io/danbooru/danbooru bash * Build the image: bin/rails danbooru:docker:build-arm * Build the image by hand: git archive HEAD | docker buildx build - --platform linux/amd64 --build-arg SOURCE_COMMIT=$(git rev-parse HEAD) -t danbooru -f Dockerfile --load
This commit is contained in:
9
.github/workflows/docker-build.yaml
vendored
9
.github/workflows/docker-build.yaml
vendored
@@ -27,6 +27,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# https://github.com/docker/setup-qemu-action
|
||||
# https://github.com/docker/setup-buildx-action#with-qemu
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
# https://github.com/docker/setup-buildx-action
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
@@ -73,6 +80,8 @@ jobs:
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#registry-cache
|
||||
# https://dev.to/pst418/speed-up-multi-stage-docker-builds-in-ci-cd-with-buildkit-s-registry-cache-11gi
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
|
||||
|
||||
Reference in New Issue
Block a user