Skip to content

musl toolchain misses rust build toolchain #227

Open

Description

@nikeee

See nodejs/docker-node#2486

This leads to the official docker image not having Temporal on musl/alpine. Temporal is just skipped if the build environment doesn't have rustc/cargo in its path.

Activity

  1. MikeMcC399 commented on May 11, 2026

    @MikeMcC399
    Contributor

    PR #228 resolved this issue for amd64

  2. MikeMcC399 commented on May 11, 2026

    @MikeMcC399
  3. sxa commented on May 11, 2026

    @sxa
    Member

    It did not address: recipes/arm64-musl for arm64

    Noting that nodejs/docker-node#2488 (mentioned in the related section in the previous comment) would be a solution for this.

  4. MikeMcC399 commented on May 11, 2026

    @MikeMcC399
  5. awbx commented on May 25, 2026

    @awbx
    Contributor

    PR for the arm64 side: #234

  6. MikeMcC399 commented on May 26, 2026

    @MikeMcC399
    Contributor

    For the downstream nodejs/docker-node repo, builds of node:alpine images for Node.js 26 now have Temporal support. nodejs/docker-node#2488 added a Rust toolchain to the Alpine Dockerfiles in that repo.

    The current setup in nodejs/docker-node does not need any further changes in unofficial-builds.

    Possibly, other consumers of builds from this repo may benefit from building with a Rust toolchain, however the recipes don't allow for differences in Node.js versions, so if a Rust toolchain is added it would also be applied to Node.js <=24 versions that are incompatible with Temporal, since they don't meet the minimum V8 requirements for Temporal.

  7. sxa commented on May 26, 2026

    @sxa
    Member

    if a Rust toolchain is added it would also be applied to Node.js <=24 versions that are incompatible with Temporal, since they don't meet the minimum V8 requirements for Temporal.

    That's not a problem - we don't use separate build containers for each node version so it just wouldn't get used pre-node26.

  8. MikeMcC399 commented on May 26, 2026

    @MikeMcC399
    Contributor

    That's not a problem - we don't use separate build containers for each node version so it just wouldn't get used pre-node26.

    I only meant that it's an extra overhead when it's not used. Sorry I wasn't very clear in what I wrote!

    alpine:3.23 is 13MB uncompressed locally
    apk add rustc cargo takes it up to 883MB

    Incremental it may only be ~400MiB

    OK: 304 MiB in 95 packages
    / # apk add rust cargo
    (1/5) Installing libxml2 (2.13.9-r0)
    (2/5) Installing llvm20-libs (20.1.8-r0)
    (3/5) Installing scudo-malloc (20.1.8-r0)
    (4/5) Installing rust (1.87.0-r1)
    (5/5) Installing cargo (1.87.0-r1)
    Executing busybox-1.37.0-r20.trigger
    OK: 698 MiB in 100 packages
    
  9. nikeee commented on May 26, 2026

    @nikeee
    MemberAuthor

    I only meant that it's an extra overhead when it's not used

    (disregard this comment if you were not talking about the Dockerfiles in docker-node):
    In docker-node, rust and cargo are installed as a virtual package in apk add --no-cache --virtual .build-deps-full, alongside the gcc toolchain.
    The entire build happens in one RUN command and runs apk del .build-deps-full to remove all build tools in the same step. So the final image size isn't impacted at all by adding rust and cargo. The only thing thats different is that the image build takes a couple of seconds longer due to the installation of rust/cargo. But they don't remain in the final image.

  10. MikeMcC399 commented on Jul 10, 2026

    @MikeMcC399
    Contributor

    The needs of node Docker Alpine builds in https://github.com/nodejs/docker-node are currently already met (see nodejs/docker-node > Dockerfile-alpine.template):

    • node Docker Alpine Linux/amd64 builds uses https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64-musl.tar.xz which is built with rust & cargo installed:

    FROM alpine:3.22
    ARG GID=1000
    ARG UID=1000
    RUN addgroup -g $GID node \
    && adduser -u $UID -G node -s /bin/sh -D node
    RUN apk add --no-cache \
    libstdc++ \
    && apk add --no-cache --virtual .build-deps \
    bash \
    binutils-gold \
    curl \
    g++ \
    gcc \
    gnupg \
    libgcc \
    linux-headers \
    make \
    python3 \
    ccache \
    xz \
    rust \
    cargo


    Future node Docker Alpine Linux/amd64 image builds would transition to using musl builds published to https://nodejs.org/download/release/ if the approved PR nodejs/node#63737 to promote Alpine/x64 to Tier 2 is merged. Preparation for this is an open action item (see also Build WG minutes https://hackmd.io/@openjs-nodejs/BJNLz8jfGg 2026-07-02).

    In that case node Docker Alpine image builds would no longer depend on https://unofficial-builds.nodejs.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions