diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae01dc3..8057788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -32,6 +34,8 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: + platforms: | + ${{ github.event_name == 'push' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} push: ${{ github.event_name == 'push' }} build-args: GITHUB_SHA tags: ekzhang/rustpad:latest diff --git a/Dockerfile b/Dockerfile index fb5c900..8e9ecbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,14 +5,14 @@ COPY . . RUN cargo test --release RUN cargo build --release -FROM rust:alpine as wasm +FROM amd64/rust:alpine as wasm WORKDIR /home/rust/src RUN apk --no-cache add curl musl-dev RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh COPY . . RUN wasm-pack build --target web rustpad-wasm -FROM node:lts-alpine as frontend +FROM amd64/node:lts-alpine as frontend WORKDIR /usr/src/app COPY package.json package-lock.json ./ COPY --from=wasm /home/rust/src/rustpad-wasm/pkg rustpad-wasm/pkg diff --git a/README.md b/README.md index 3ab1a38..759bcaf 100644 --- a/README.md +++ b/README.md @@ -96,16 +96,16 @@ following environment variables on startup: Rustpad is distributed as a single 6 MB Docker image, which is built automatically from the `Dockerfile` in this repository. You can pull the latest -version of this image from Docker Hub. +version of this image from Docker Hub. It has multi-platform support for +`linux/amd64` and `linux/arm64`. ``` docker pull ekzhang/rustpad ``` (You can also manually build this image with `docker build -t rustpad .` in the -project root directory, ensuring that your target platform is `linux/amd64`.) To -run locally, execute the following command, then open `http://localhost:3030` in -your browser. +project root directory.) To run locally, execute the following command, then +open `http://localhost:3030` in your browser. ``` docker run --rm -dp 3030:3030 ekzhang/rustpad