From 8f24ab49a00c51e35eec47a17b0e21c01b352bb8 Mon Sep 17 00:00:00 2001 From: Gyuheon Oh Date: Thu, 26 Mar 2026 11:47:48 -0400 Subject: [PATCH] allow for build on alpine aarch64 --- .cargo/config.toml | 6 +++++ .devcontainer/alpine/Dockerfile-alpine | 2 ++ .devcontainer/alpine/devcontainer.json | 32 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .devcontainer/alpine/Dockerfile-alpine create mode 100644 .devcontainer/alpine/devcontainer.json diff --git a/.cargo/config.toml b/.cargo/config.toml index 9d0e397..d64e09f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,3 +3,9 @@ rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"] [target.aarch64-apple-darwin] rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"] + +[target.aarch64-unknown-linux-musl] +rustflags = ["-C", "target-feature=-crt-static"] + +[target.x86_64-unknown-linux-musl] +rustflags = ["-C", "target-feature=-crt-static"] diff --git a/.devcontainer/alpine/Dockerfile-alpine b/.devcontainer/alpine/Dockerfile-alpine new file mode 100644 index 0000000..2301553 --- /dev/null +++ b/.devcontainer/alpine/Dockerfile-alpine @@ -0,0 +1,2 @@ +FROM node:20-alpine +RUN apk add --no-cache bash diff --git a/.devcontainer/alpine/devcontainer.json b/.devcontainer/alpine/devcontainer.json new file mode 100644 index 0000000..03f937b --- /dev/null +++ b/.devcontainer/alpine/devcontainer.json @@ -0,0 +1,32 @@ +{ + "name": "Node (Alpine ARM64)", + "build": { + "dockerfile": "Dockerfile-alpine" + }, + +// Ensure ARM64 platform + "runArgs": [ + "--platform=linux/arm64", + "--network=host" + ], + // Persist npm cache + "mounts": [ + { + "source": "devcontainer-npm-cache-${devcontainerId}", + "target": "/root/.npm", + "type": "volume" + } + ], + // Install useful Alpine + Node tooling + Rust + libdatadog build dependencies + "onCreateCommand": "apk add --no-cache git bash build-base python3 autoconf automake libtool gcc libc-dev curl musl-dev linux-headers libgcc gcompat && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source ~/.cargo/env && rustup target add aarch64-unknown-linux-gnu", + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "ms-vscode.vscode-typescript-next", + "ms-azuretools.vscode-docker" + ] + } + } +}