From f337ed5638b66c237c4bb47714caf7e5a9ac4fbc Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 18 Jan 2022 13:41:44 +0800 Subject: [PATCH] build: add musl zig cross build image --- .github/workflows/docker.yaml | 8 ++++++++ alpine-zig.Dockerfile | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 alpine-zig.Dockerfile diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index f4a6cce5..9a21d84e 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -49,6 +49,14 @@ jobs: push: true tags: ghcr.io/${{ github.repository }}/nodejs-rust:lts-debian-zig + - name: Build and push alpine with zig + uses: docker/build-push-action@v2 + with: + file: alpine-zig.Dockerfile + platforms: linux/amd64 + push: true + tags: ghcr.io/${{ github.repository }}/nodejs-rust:lts-alpine-zig + build_image_arm: name: Build Node.js arm images strategy: diff --git a/alpine-zig.Dockerfile b/alpine-zig.Dockerfile new file mode 100644 index 00000000..f71c4dc7 --- /dev/null +++ b/alpine-zig.Dockerfile @@ -0,0 +1,11 @@ +FROM ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + +ARG ZIG_VERSION=0.9.0 + +RUN apk add xz && \ + rustup target add x86_64-unknown-linux-gnu && \ + wget https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz && \ + tar -xvf zig-linux-x86_64-${ZIG_VERSION}.tar.xz && \ + mv zig-linux-x86_64-${ZIG_VERSION} /usr/local/zig && \ + ln -sf /usr/local/zig/zig /usr/local/bin/zig && \ + rm zig-linux-x86_64-${ZIG_VERSION}.tar.xz