Something went wrong. Try again.
An experimental port of NetBSD, FreeBSD, OpenBSD, and XNU to unkernel unkernel.dev
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152# SPDX-License-Identifier: GPL-2.0-or-later# Copyright (C) 2026 Tsiry Sandratraina# The Linux build host that kernel/build.sh uses on macOS# (kernel/tools/docker-build.sh builds and runs it; .agents/toolchain.md,# macOS host): Ubuntu 24.04 with clang, lld and the llvm tools 22 from# apt.llvm.org, Zig 0.16.0 and Node 26 (JSPI on by default; checksums# pinned), and the packages# setup.sh checks for. The repository is mounted at /work.FROM ubuntu:24.04ARG TARGETARCHARG ZIG_VERSION=0.16.0ARG NODE_VERSION=26.13.0ENV DEBIAN_FRONTEND=noninteractiveRUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \ curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key -o /etc/apt/keyrings/apt.llvm.org.asc && \ echo "deb [signed-by=/etc/apt/keyrings/apt.llvm.org.asc] http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" \ > /etc/apt/sources.list.d/llvm.list && \ apt-get update && apt-get install -y --no-install-recommends \ clang-22 lld-22 llvm-22 \ build-essential cmake ninja-build flex bison bc m4 python3 git \ xz-utils zstd bzip2 gzip tar patch perl rsync cpio file pkg-config \ e2fsprogs libssl-dev libelf-dev uuid-dev \ autoconf automake libtool gettext && \ rm -rf /var/lib/apt/lists/*# Zig and Node from their release tarballs, by the container's architecture.RUN set -eu; \ case "$TARGETARCH" in \ amd64) zarch=x86_64; narch=x64; \ zsum=70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00; \ nsum=d28a96af6c38596f6d9d97c0ee531c13d238d757742387d1928de822d959e997 ;; \ arm64) zarch=aarch64; narch=arm64; \ zsum=ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17; \ nsum=406fe3fbde1c054adff8b297c16fdb5af6659db327c1ac8acd46b56ef1af9a92 ;; \ *) echo "no Zig and Node downloads pinned for $TARGETARCH" >&2; exit 1 ;; \ esac; \ curl -fsSL -o /tmp/zig.tar.xz "https://ziglang.org/download/$ZIG_VERSION/zig-$zarch-linux-$ZIG_VERSION.tar.xz"; \ echo "$zsum /tmp/zig.tar.xz" | sha256sum -c -; \ tar -C /opt -xJf /tmp/zig.tar.xz; \ ln -s "/opt/zig-$zarch-linux-$ZIG_VERSION/zig" /usr/local/bin/zig; \ curl -fsSL -o /tmp/node.tar.xz "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$narch.tar.xz"; \ echo "$nsum /tmp/node.tar.xz" | sha256sum -c -; \ tar -C /opt -xJf /tmp/node.tar.xz; \ ln -s "/opt/node-v$NODE_VERSION-linux-$narch/bin/node" /usr/local/bin/node; \ ln -s "/opt/node-v$NODE_VERSION-linux-$narch/bin/npm" /usr/local/bin/npm; \ rm /tmp/zig.tar.xz /tmp/node.tar.xz# The unversioned clang, ld.lld and llvm-* names; Zig's caches off the# repository mount (/kw is the kw-cache volume).ENV PATH=/usr/lib/llvm-22/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ ZIG_GLOBAL_CACHE_DIR=/kw/zig-cache/global \ ZIG_LOCAL_CACHE_DIR=/kw/zig-cache/localWORKDIR /work