Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/build-static-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ jobs:
build:
runs-on: ${{ matrix.IMAGE.RUNNER }}
needs: load-node-versions
timeout-minutes: 480
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
IMAGE:
- {RUNNER: "ubuntu-latest", MANYLINUX_ARCH: "x86_64"}
- {RUNNER: "ubuntu-24.04-arm", MANYLINUX_ARCH: "aarch64"}
- {RUNNER: "ubuntu-24.04-ppc64le", MANYLINUX_ARCH: "ppc64le"}
- {RUNNER: "ubuntu-latest", MANYLINUX_IMAGE: "quay.io/pypa/manylinux2014_x86_64"}
- {RUNNER: "ubuntu-24.04-arm", MANYLINUX_IMAGE: "quay.io/pypa/manylinux2014_aarch64"}
- {RUNNER: "ubuntu-24.04-ppc64le", MANYLINUX_IMAGE: "quay.io/pypa/manylinux2014_ppc64le"}
- {RUNNER: "ubuntu-24.04-riscv", MANYLINUX_IMAGE: "quay.io/pypa/manylinux_2_39_riscv64"}
NODE_CONFIG: ${{ fromJson(needs.load-node-versions.outputs.versions) }}
steps:
- uses: actions/checkout@v6.0.1
Expand All @@ -54,10 +56,10 @@ jobs:
run: |
echo building node.js $NODE_VERSION
docker build --tag ghcr.io/pyca/static-nodejs-$NODE_ARCH:$NODE_VERSION --build-arg VERSION=$NODE_VERSION --build-arg ARCH=$NODE_ARCH --build-arg SHA256SUM=$NODE_SHA256SUM staticnode
- name: Test static node.js on manylinux2014
- name: Test static node.js
run: |
cd staticnode
docker build -f Dockerfile-test -t test-node --build-arg MANYLINUX_ARCH=${{ matrix.IMAGE.MANYLINUX_ARCH }} --build-arg CONTAINER_NAME=ghcr.io/pyca/static-nodejs-$NODE_ARCH:$NODE_VERSION .
docker build -f Dockerfile-test -t test-node --build-arg MANYLINUX_IMAGE=${{ matrix.IMAGE.MANYLINUX_IMAGE }} --build-arg CONTAINER_NAME=ghcr.io/pyca/static-nodejs-$NODE_ARCH:$NODE_VERSION .
docker run test-node /staticnode/bin/node -e "console.log('hello world'); console.log(process.version)"
- name: Login to docker
run: 'docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" ghcr.io'
Expand Down
14 changes: 10 additions & 4 deletions staticnode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM alpine:latest
FROM alpine:3.21
ARG VERSION
# One of x64 or arm64 or ppc64le
# One of x64 or arm64 or ppc64le or riscv64
ARG ARCH
# The sha256sum for the node source tarball
ARG SHA256SUM

RUN mkdir -p /build
WORKDIR /build

RUN apk add --no-cache binutils-gold curl g++ gcc gnupg libgcc linux-headers make python3 libstdc++ patch
RUN if [ "$ARCH" = "riscv64" ]; then \
apk add --no-cache binutils curl g++ gcc gnupg libgcc linux-headers make python3 libstdc++ patch; \
else \
apk add --no-cache binutils-gold curl g++ gcc gnupg libgcc linux-headers make python3 libstdc++ patch; \
fi
RUN mkdir -p /out/bin

RUN curl -O https://nodejs.org/dist/$VERSION/node-$VERSION.tar.gz
Expand All @@ -28,7 +32,9 @@ RUN cd node-$VERSION && \
ppc64le) CPU=ppc64 ;; \
*) CPU="$ARCH" ;; \
esac && \
./configure --dest-cpu=$CPU --fully-static && \
EXTRA_FLAGS="" && \
if [ "$ARCH" = "riscv64" ]; then EXTRA_FLAGS="--openssl-no-asm"; fi && \
./configure --dest-cpu=$CPU --fully-static $EXTRA_FLAGS && \
make -j$(nproc)

RUN cp /build/node-$VERSION/LICENSE /out/LICENSE && cp /build/node-$VERSION/out/Release/node /out/bin/node
Expand Down
4 changes: 2 additions & 2 deletions staticnode/Dockerfile-test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG MANYLINUX_ARCH
ARG MANYLINUX_IMAGE
ARG CONTAINER_NAME
FROM ${CONTAINER_NAME} AS staticnodejs
FROM quay.io/pypa/manylinux2014_${MANYLINUX_ARCH}
FROM ${MANYLINUX_IMAGE}

COPY --from=staticnodejs /out /staticnode/