From eee668060d4abf9ea993e0905390ec4fafa2747a Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 29 Jul 2026 20:27:25 +0000 Subject: [PATCH 1/3] feat(images/universal): build multi-arch image from enterprise-base The devcontainers/universal base image is amd64-only, which forced the universal image to be pinned to linux/amd64 via a .platforms override. Rebuild the image on codercom/enterprise-base:ubuntu instead, installing the language toolchains it provided (Node.js, Go, Java, .NET, Ruby, PHP, Rust) plus the GitHub CLI and common utilities, all from multi-arch sources. Google Chrome only ships amd64 packages, so arm64 builds use Playwright's Chromium instead. Remove the .platforms override so the image builds for both linux/amd64 and linux/arm64 like the rest of the images. --- images/universal/.platforms | 1 - images/universal/README.md | 15 +++- images/universal/ubuntu.Dockerfile | 106 ++++++++++++++++++++++------- 3 files changed, 94 insertions(+), 28 deletions(-) delete mode 100644 images/universal/.platforms diff --git a/images/universal/.platforms b/images/universal/.platforms deleted file mode 100644 index 303dc7a..0000000 --- a/images/universal/.platforms +++ /dev/null @@ -1 +0,0 @@ -linux/amd64 diff --git a/images/universal/README.md b/images/universal/README.md index 5742b54..2c5d107 100644 --- a/images/universal/README.md +++ b/images/universal/README.md @@ -4,4 +4,17 @@ ## Description -Microsoft's [Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal) with the upstream `codespace` user renamed to `coder`. The image keeps the base shell environment while rewriting hardcoded home paths and preserving inherited `PATH` entries for Coder's injected tooling. +A multi-language "kitchen sink" image built on `codercom/enterprise-base:ubuntu`, published for `linux/amd64` and `linux/arm64`. It replaces the previous build based on Microsoft's [Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal), which is only published for amd64. + +Included toolchains and utilities: + +- Python 3 (with `pipx` and `venv`, inherited from the base image) +- Node.js LTS (with `yarn` and `pnpm` via Corepack) +- Go +- Java (OpenJDK 21) +- .NET SDK 8.0 +- Ruby +- PHP (with Composer) +- Rust (via `rustup`, installed for the `coder` user) +- Docker, Git, GitHub CLI, and common shell utilities +- A Playwright-managed browser for AI browser testing (Google Chrome on amd64, Chromium on arm64, at `/usr/local/ms-playwright`) diff --git a/images/universal/ubuntu.Dockerfile b/images/universal/ubuntu.Dockerfile index d4664f4..d40ef6d 100644 --- a/images/universal/ubuntu.Dockerfile +++ b/images/universal/ubuntu.Dockerfile @@ -1,33 +1,87 @@ -ARG UBUNTU_VERSION=noble -FROM mcr.microsoft.com/devcontainers/universal:${UBUNTU_VERSION} +FROM codercom/enterprise-base:ubuntu +# Run everything as root USER root +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +# TARGETARCH is set by buildx/depot to amd64 or arm64 depending on the +# platform being built. It drives the arch-specific installs below. +ARG TARGETARCH + COPY first-run-notice.txt /usr/local/etc/vscode-dev-containers/ -# Remove Conda to avoid any license issues -RUN rm -R /opt/conda && \ - rm /usr/local/etc/vscode-dev-containers/conda-notice.txt - -# Install Chrome for AI Browser Testing -RUN yes | npx playwright install chrome - -# Rename the upstream `codespace` user to `coder` so we preserve the -# existing home directory and shell environment provided by the base image. -RUN usermod -l coder codespace && \ - groupmod -n coder codespace && \ - usermod -d /home/coder -m coder && \ - usermod -aG docker,sudo coder && \ - sed -i \ - -e 's#/home/codespace#/home/coder#g' \ - -e 's#^export PATH=#export PATH=${PATH:+$PATH:}#' \ - /etc/profile.d/00-restore-env.sh && \ - sed -i \ - -e 's#codespace#coder#g' \ - -e 's#/home/codespace#/home/coder#g' \ - /etc/sudoers.d/codespace && \ - mv /etc/sudoers.d/codespace /etc/sudoers.d/coder && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/nopasswd && \ - chmod 0440 /etc/sudoers.d/coder /etc/sudoers.d/nopasswd +# Install common CLI tooling and language runtimes that are multi-arch +# in the Ubuntu archive: Java, .NET, Ruby, PHP (with Composer), and +# supporting build/network utilities. +RUN apt-get update && \ + apt-get install --yes --no-install-recommends --no-install-suggests \ + composer \ + dnsutils \ + dotnet-sdk-8.0 \ + gnupg \ + less \ + libssl-dev \ + make \ + moreutils \ + net-tools \ + openjdk-21-jdk \ + openssh-client \ + php-cli \ + pkg-config \ + python3-venv \ + ruby-full \ + screen \ + tmux \ + tree \ + zip \ + zsh \ + && rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} +ENV PATH=$PATH:$JAVA_HOME/bin + +# Install the GitHub CLI from its official apt repository (multi-arch) +RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \ + chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \ + echo "deb [arch=${TARGETARCH} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" >/etc/apt/sources.list.d/github-cli.list && \ + apt-get update && \ + apt-get install --yes --no-install-recommends --no-install-suggests gh && \ + rm -rf /var/lib/apt/lists/* + +# Install Go from the official multi-arch release tarballs +ARG GO_VERSION=1.26.5 +RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" | tar -C /usr/local -xz +ENV GOROOT=/usr/local/go +ENV GOPATH=/home/coder/go +ENV GOBIN=$GOPATH/bin +ENV PATH=$PATH:$GOROOT/bin:$GOBIN + +# Install Node.js (LTS) via NodeSource (multi-arch), then enable +# Corepack so yarn and pnpm are available without extra repositories. +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ + apt-get install --yes --no-install-recommends --no-install-suggests nodejs && \ + rm -rf /var/lib/apt/lists/* && \ + corepack enable + +# Install a Playwright-managed browser for AI browser testing into a +# shared, world-readable location. Google Chrome only ships linux/amd64 +# packages, so arm64 uses Playwright's Chromium build instead. +ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/ms-playwright +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + yes | npx playwright install chrome; \ + else \ + npx playwright install --with-deps chromium; \ + fi && \ + npm cache clean --force && \ + rm -rf /var/lib/apt/lists/* && \ + { [ ! -d "$PLAYWRIGHT_BROWSERS_PATH" ] || chmod -R a+rX "$PLAYWRIGHT_BROWSERS_PATH"; } + +# Set back to coder user USER coder + +# Install Rust for the coder user via rustup (multi-arch) +RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path +ENV PATH=$PATH:/home/coder/.cargo/bin From 6d0feceb0468d0099a7c3f093853418f20c89a17 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 29 Jul 2026 20:41:21 +0000 Subject: [PATCH 2/3] feat(images/kitchensink): add multi-arch kitchensink image The universal image is pinned to linux/amd64 because its upstream base (devcontainers/universal) is amd64-only. Add a new kitchensink image built on codercom/enterprise-base:ubuntu that provides the same broad toolchain (Node.js, Go, Java, .NET, Ruby, PHP, Rust, GitHub CLI) from multi-arch sources, for both linux/amd64 and linux/arm64. Google Chrome only ships amd64 packages, so arm64 builds use Playwright's Chromium instead. The universal image is unchanged. --- images/kitchensink/README.md | 20 +++++ images/kitchensink/first-run-notice.txt | 6 ++ images/kitchensink/ubuntu.Dockerfile | 87 +++++++++++++++++++ images/universal/.platforms | 1 + images/universal/README.md | 15 +--- images/universal/ubuntu.Dockerfile | 106 ++++++------------------ scripts/images.sh | 1 + 7 files changed, 142 insertions(+), 94 deletions(-) create mode 100644 images/kitchensink/README.md create mode 100644 images/kitchensink/first-run-notice.txt create mode 100644 images/kitchensink/ubuntu.Dockerfile create mode 100644 images/universal/.platforms diff --git a/images/kitchensink/README.md b/images/kitchensink/README.md new file mode 100644 index 0000000..77aa23c --- /dev/null +++ b/images/kitchensink/README.md @@ -0,0 +1,20 @@ +# Example Kitchensink Image + +[![Docker Pulls](https://img.shields.io/docker/pulls/codercom/example-kitchensink?label=codercom%2Fexample-kitchensink)](https://hub.docker.com/r/codercom/example-kitchensink) + +## Description + +A multi-language "kitchen sink" image built on `codercom/enterprise-base:ubuntu`, published for `linux/amd64` and `linux/arm64`. It offers a multi-arch alternative to the `universal` image, whose upstream base ([Microsoft's Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal)) is only published for amd64. + +Included toolchains and utilities: + +- Python 3 (with `pipx` and `venv`, inherited from the base image) +- Node.js LTS (with `yarn` and `pnpm` via Corepack) +- Go +- Java (OpenJDK 21) +- .NET SDK 8.0 +- Ruby +- PHP (with Composer) +- Rust (via `rustup`, installed for the `coder` user) +- Docker, Git, GitHub CLI, and common shell utilities +- A Playwright-managed browser for AI browser testing (Google Chrome on amd64, Chromium on arm64, at `/usr/local/ms-playwright`) diff --git a/images/kitchensink/first-run-notice.txt b/images/kitchensink/first-run-notice.txt new file mode 100644 index 0000000..0d8bf44 --- /dev/null +++ b/images/kitchensink/first-run-notice.txt @@ -0,0 +1,6 @@ +Welcome to Coder! This environment includes a suite of common tools and languages +(Python, Java, Node.js, Go, Rust, .NET, Ruby, PHP, etc.) for both amd64 and arm64. + +➡️ https://github.com/coder/images/tree/main/images/kitchensink + +To use another image, modify your devcontainer.json or your Coder Template. diff --git a/images/kitchensink/ubuntu.Dockerfile b/images/kitchensink/ubuntu.Dockerfile new file mode 100644 index 0000000..f898d26 --- /dev/null +++ b/images/kitchensink/ubuntu.Dockerfile @@ -0,0 +1,87 @@ +FROM codercom/enterprise-base:ubuntu + +# Run everything as root +USER root + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +# TARGETARCH is set by buildx/depot to amd64 or arm64 depending on the +# platform being built. It drives the arch-specific installs below. +ARG TARGETARCH + +# Install common CLI tooling and language runtimes that are multi-arch +# in the Ubuntu archive: Java, .NET, Ruby, PHP (with Composer), and +# supporting build/network utilities. +RUN apt-get update && \ + apt-get install --yes --no-install-recommends --no-install-suggests \ + composer \ + dnsutils \ + dotnet-sdk-8.0 \ + gnupg \ + less \ + libssl-dev \ + make \ + moreutils \ + net-tools \ + openjdk-21-jdk \ + openssh-client \ + php-cli \ + pkg-config \ + python3-venv \ + ruby-full \ + screen \ + tmux \ + tree \ + zip \ + zsh \ + && rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} +ENV PATH=$PATH:$JAVA_HOME/bin + +# Install the GitHub CLI from its official apt repository (multi-arch) +RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \ + chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \ + echo "deb [arch=${TARGETARCH} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" >/etc/apt/sources.list.d/github-cli.list && \ + apt-get update && \ + apt-get install --yes --no-install-recommends --no-install-suggests gh && \ + rm -rf /var/lib/apt/lists/* + +# Install Go from the official multi-arch release tarballs +ARG GO_VERSION=1.26.5 +RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" | tar -C /usr/local -xz + +ENV GOROOT=/usr/local/go +ENV GOPATH=/home/coder/go +ENV GOBIN=$GOPATH/bin +ENV PATH=$PATH:$GOROOT/bin:$GOBIN + +# Install Node.js (LTS) via NodeSource (multi-arch), then enable +# Corepack so yarn and pnpm are available without extra repositories. +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ + apt-get install --yes --no-install-recommends --no-install-suggests nodejs && \ + rm -rf /var/lib/apt/lists/* && \ + corepack enable + +# Install a Playwright-managed browser for AI browser testing into a +# shared, world-readable location. Google Chrome only ships linux/amd64 +# packages, so arm64 uses Playwright's Chromium build instead. +ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/ms-playwright +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + yes | npx playwright install chrome; \ + else \ + npx playwright install --with-deps chromium; \ + fi && \ + npm cache clean --force && \ + rm -rf /var/lib/apt/lists/* && \ + { [ ! -d "$PLAYWRIGHT_BROWSERS_PATH" ] || chmod -R a+rX "$PLAYWRIGHT_BROWSERS_PATH"; } + +COPY first-run-notice.txt /usr/local/etc/vscode-dev-containers/ + +# Set back to coder user +USER coder + +# Install Rust for the coder user via rustup (multi-arch) +RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path +ENV PATH=$PATH:/home/coder/.cargo/bin diff --git a/images/universal/.platforms b/images/universal/.platforms new file mode 100644 index 0000000..303dc7a --- /dev/null +++ b/images/universal/.platforms @@ -0,0 +1 @@ +linux/amd64 diff --git a/images/universal/README.md b/images/universal/README.md index 2c5d107..5742b54 100644 --- a/images/universal/README.md +++ b/images/universal/README.md @@ -4,17 +4,4 @@ ## Description -A multi-language "kitchen sink" image built on `codercom/enterprise-base:ubuntu`, published for `linux/amd64` and `linux/arm64`. It replaces the previous build based on Microsoft's [Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal), which is only published for amd64. - -Included toolchains and utilities: - -- Python 3 (with `pipx` and `venv`, inherited from the base image) -- Node.js LTS (with `yarn` and `pnpm` via Corepack) -- Go -- Java (OpenJDK 21) -- .NET SDK 8.0 -- Ruby -- PHP (with Composer) -- Rust (via `rustup`, installed for the `coder` user) -- Docker, Git, GitHub CLI, and common shell utilities -- A Playwright-managed browser for AI browser testing (Google Chrome on amd64, Chromium on arm64, at `/usr/local/ms-playwright`) +Microsoft's [Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal) with the upstream `codespace` user renamed to `coder`. The image keeps the base shell environment while rewriting hardcoded home paths and preserving inherited `PATH` entries for Coder's injected tooling. diff --git a/images/universal/ubuntu.Dockerfile b/images/universal/ubuntu.Dockerfile index d40ef6d..d4664f4 100644 --- a/images/universal/ubuntu.Dockerfile +++ b/images/universal/ubuntu.Dockerfile @@ -1,87 +1,33 @@ -FROM codercom/enterprise-base:ubuntu +ARG UBUNTU_VERSION=noble +FROM mcr.microsoft.com/devcontainers/universal:${UBUNTU_VERSION} -# Run everything as root USER root -SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive - -# TARGETARCH is set by buildx/depot to amd64 or arm64 depending on the -# platform being built. It drives the arch-specific installs below. -ARG TARGETARCH - COPY first-run-notice.txt /usr/local/etc/vscode-dev-containers/ -# Install common CLI tooling and language runtimes that are multi-arch -# in the Ubuntu archive: Java, .NET, Ruby, PHP (with Composer), and -# supporting build/network utilities. -RUN apt-get update && \ - apt-get install --yes --no-install-recommends --no-install-suggests \ - composer \ - dnsutils \ - dotnet-sdk-8.0 \ - gnupg \ - less \ - libssl-dev \ - make \ - moreutils \ - net-tools \ - openjdk-21-jdk \ - openssh-client \ - php-cli \ - pkg-config \ - python3-venv \ - ruby-full \ - screen \ - tmux \ - tree \ - zip \ - zsh \ - && rm -rf /var/lib/apt/lists/* - -ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} -ENV PATH=$PATH:$JAVA_HOME/bin - -# Install the GitHub CLI from its official apt repository (multi-arch) -RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \ - chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \ - echo "deb [arch=${TARGETARCH} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" >/etc/apt/sources.list.d/github-cli.list && \ - apt-get update && \ - apt-get install --yes --no-install-recommends --no-install-suggests gh && \ - rm -rf /var/lib/apt/lists/* - -# Install Go from the official multi-arch release tarballs -ARG GO_VERSION=1.26.5 -RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" | tar -C /usr/local -xz +# Remove Conda to avoid any license issues +RUN rm -R /opt/conda && \ + rm /usr/local/etc/vscode-dev-containers/conda-notice.txt + +# Install Chrome for AI Browser Testing +RUN yes | npx playwright install chrome + +# Rename the upstream `codespace` user to `coder` so we preserve the +# existing home directory and shell environment provided by the base image. +RUN usermod -l coder codespace && \ + groupmod -n coder codespace && \ + usermod -d /home/coder -m coder && \ + usermod -aG docker,sudo coder && \ + sed -i \ + -e 's#/home/codespace#/home/coder#g' \ + -e 's#^export PATH=#export PATH=${PATH:+$PATH:}#' \ + /etc/profile.d/00-restore-env.sh && \ + sed -i \ + -e 's#codespace#coder#g' \ + -e 's#/home/codespace#/home/coder#g' \ + /etc/sudoers.d/codespace && \ + mv /etc/sudoers.d/codespace /etc/sudoers.d/coder && \ + echo "coder ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/nopasswd && \ + chmod 0440 /etc/sudoers.d/coder /etc/sudoers.d/nopasswd -ENV GOROOT=/usr/local/go -ENV GOPATH=/home/coder/go -ENV GOBIN=$GOPATH/bin -ENV PATH=$PATH:$GOROOT/bin:$GOBIN - -# Install Node.js (LTS) via NodeSource (multi-arch), then enable -# Corepack so yarn and pnpm are available without extra repositories. -RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ - apt-get install --yes --no-install-recommends --no-install-suggests nodejs && \ - rm -rf /var/lib/apt/lists/* && \ - corepack enable - -# Install a Playwright-managed browser for AI browser testing into a -# shared, world-readable location. Google Chrome only ships linux/amd64 -# packages, so arm64 uses Playwright's Chromium build instead. -ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/ms-playwright -RUN if [ "$TARGETARCH" = "amd64" ]; then \ - yes | npx playwright install chrome; \ - else \ - npx playwright install --with-deps chromium; \ - fi && \ - npm cache clean --force && \ - rm -rf /var/lib/apt/lists/* && \ - { [ ! -d "$PLAYWRIGHT_BROWSERS_PATH" ] || chmod -R a+rX "$PLAYWRIGHT_BROWSERS_PATH"; } - -# Set back to coder user USER coder - -# Install Rust for the coder user via rustup (multi-arch) -RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path -ENV PATH=$PATH:/home/coder/.cargo/bin diff --git a/scripts/images.sh b/scripts/images.sh index 36a2ed3..e6c4e4b 100644 --- a/scripts/images.sh +++ b/scripts/images.sh @@ -17,4 +17,5 @@ IMAGES=( "node" "desktop" "universal" + "kitchensink" ) From 977b0ab65539e0532043670ac5c14a2d5b10192b Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 29 Jul 2026 20:59:05 +0000 Subject: [PATCH 3/3] refactor(images/kitchensink): install toolchains via Homebrew and mise Replace the apt/tarball toolchain installs with Homebrew, which as of 5.0 supports Linux ARM64/AArch64 as Tier 1, so a single package source covers both platforms. Toolchains and dev tools (Go, Node.js, Ruby, Kotlin, Gradle, Maven, mise, just, OpenTofu, and friends) come from brew, Python from uv, and Rust from rustup with cargo-binstall and cargo-nextest. Everything installs as the coder user. --- images/kitchensink/README.md | 18 ++- images/kitchensink/first-run-notice.txt | 3 +- images/kitchensink/ubuntu.Dockerfile | 153 ++++++++++++++---------- 3 files changed, 97 insertions(+), 77 deletions(-) diff --git a/images/kitchensink/README.md b/images/kitchensink/README.md index 77aa23c..784fdcf 100644 --- a/images/kitchensink/README.md +++ b/images/kitchensink/README.md @@ -6,15 +6,11 @@ A multi-language "kitchen sink" image built on `codercom/enterprise-base:ubuntu`, published for `linux/amd64` and `linux/arm64`. It offers a multi-arch alternative to the `universal` image, whose upstream base ([Microsoft's Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal)) is only published for amd64. -Included toolchains and utilities: +Toolchains are installed via Homebrew (Tier 1 on Linux ARM64 as of Homebrew 5.0), plus dedicated version managers: -- Python 3 (with `pipx` and `venv`, inherited from the base image) -- Node.js LTS (with `yarn` and `pnpm` via Corepack) -- Go -- Java (OpenJDK 21) -- .NET SDK 8.0 -- Ruby -- PHP (with Composer) -- Rust (via `rustup`, installed for the `coder` user) -- Docker, Git, GitHub CLI, and common shell utilities -- A Playwright-managed browser for AI browser testing (Google Chrome on amd64, Chromium on arm64, at `/usr/local/ms-playwright`) +- Homebrew: Go (with `gofumpt`, `golangci-lint`, `staticcheck`), Node.js (with `yarn`, `pnpm`, `fnm`), Ruby, Kotlin, Gradle, Maven, `mise`, `just`, `ninja`, `cmake`, OpenTofu, `fish`, `typos-cli`, `clang-format`, `pkgconf`, `rebar3` +- `uv` with a default Python install +- Rust via `rustup` (with `cargo-binstall` and `cargo-nextest`) +- Docker, Git, and common shell utilities inherited from the base image + +All user-facing tooling runs as the `coder` user. diff --git a/images/kitchensink/first-run-notice.txt b/images/kitchensink/first-run-notice.txt index 0d8bf44..1e3a24f 100644 --- a/images/kitchensink/first-run-notice.txt +++ b/images/kitchensink/first-run-notice.txt @@ -1,5 +1,6 @@ Welcome to Coder! This environment includes a suite of common tools and languages -(Python, Java, Node.js, Go, Rust, .NET, Ruby, PHP, etc.) for both amd64 and arm64. +managed via Homebrew, mise, uv, fnm, and rustup (Go, Node.js, Python, Rust, Ruby, +Java/Kotlin, and more) for both amd64 and arm64. ➡️ https://github.com/coder/images/tree/main/images/kitchensink diff --git a/images/kitchensink/ubuntu.Dockerfile b/images/kitchensink/ubuntu.Dockerfile index f898d26..569572c 100644 --- a/images/kitchensink/ubuntu.Dockerfile +++ b/images/kitchensink/ubuntu.Dockerfile @@ -6,82 +6,105 @@ USER root SHELL ["/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive -# TARGETARCH is set by buildx/depot to amd64 or arm64 depending on the -# platform being built. It drives the arch-specific installs below. -ARG TARGETARCH +################################################################################ +# System packages # +################################################################################ -# Install common CLI tooling and language runtimes that are multi-arch -# in the Ubuntu archive: Java, .NET, Ruby, PHP (with Composer), and -# supporting build/network utilities. +# The base image already provides build-essential, curl, git, jq, sudo, +# wget, python3, pipx, and Docker. RUN apt-get update && \ apt-get install --yes --no-install-recommends --no-install-suggests \ - composer \ - dnsutils \ - dotnet-sdk-8.0 \ - gnupg \ + autoconf \ + automake \ + ca-certificates \ + cmake \ less \ - libssl-dev \ - make \ - moreutils \ - net-tools \ - openjdk-21-jdk \ - openssh-client \ - php-cli \ - pkg-config \ - python3-venv \ - ruby-full \ - screen \ - tmux \ - tree \ - zip \ + sqlite3 \ zsh \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} +COPY first-run-notice.txt /usr/local/etc/vscode-dev-containers/ + +# Everything below installs into user-owned prefixes as the coder user. +USER coder +ENV HOME=/home/coder +ENV PATH=$HOME/.local/bin:$PATH + +################################################################################ +# Homebrew # +################################################################################ + +# Homebrew 5.0 supports Linux ARM64/AArch64 as Tier 1, so bottles exist +# for both platforms this image builds for. +ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH +RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +RUN brew install \ + cargo-binstall \ + clang-format \ + fish \ + fnm \ + go \ + gofumpt \ + golangci-lint \ + gradle \ + just \ + kotlin \ + maven \ + mise \ + ninja \ + node \ + opentofu \ + pkgconf \ + pnpm \ + rebar3 \ + ruby \ + staticcheck \ + typos-cli \ + uv \ + yarn \ + && brew cleanup --prune=all && \ + rm -rf "$(brew --cache)" + +# openjdk is keg-only in Homebrew, so expose it explicitly for tools +# that expect java on PATH. +ENV JAVA_HOME=/home/linuxbrew/.linuxbrew/opt/openjdk ENV PATH=$PATH:$JAVA_HOME/bin -# Install the GitHub CLI from its official apt repository (multi-arch) -RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \ - chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \ - echo "deb [arch=${TARGETARCH} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" >/etc/apt/sources.list.d/github-cli.list && \ - apt-get update && \ - apt-get install --yes --no-install-recommends --no-install-suggests gh && \ - rm -rf /var/lib/apt/lists/* +################################################################################ +# uv # +################################################################################ -# Install Go from the official multi-arch release tarballs -ARG GO_VERSION=1.26.5 -RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" | tar -C /usr/local -xz +RUN uv python install --default 3.14 -ENV GOROOT=/usr/local/go -ENV GOPATH=/home/coder/go -ENV GOBIN=$GOPATH/bin -ENV PATH=$PATH:$GOROOT/bin:$GOBIN - -# Install Node.js (LTS) via NodeSource (multi-arch), then enable -# Corepack so yarn and pnpm are available without extra repositories. -RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ - apt-get install --yes --no-install-recommends --no-install-suggests nodejs && \ - rm -rf /var/lib/apt/lists/* && \ - corepack enable - -# Install a Playwright-managed browser for AI browser testing into a -# shared, world-readable location. Google Chrome only ships linux/amd64 -# packages, so arm64 uses Playwright's Chromium build instead. -ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/ms-playwright -RUN if [ "$TARGETARCH" = "amd64" ]; then \ - yes | npx playwright install chrome; \ - else \ - npx playwright install --with-deps chromium; \ - fi && \ - npm cache clean --force && \ - rm -rf /var/lib/apt/lists/* && \ - { [ ! -d "$PLAYWRIGHT_BROWSERS_PATH" ] || chmod -R a+rX "$PLAYWRIGHT_BROWSERS_PATH"; } +################################################################################ +# rustup # +################################################################################ -COPY first-run-notice.txt /usr/local/etc/vscode-dev-containers/ +ENV PATH=$HOME/.cargo/bin:$PATH +RUN curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y \ + --no-modify-path -# Set back to coder user -USER coder +RUN cargo binstall cargo-nextest --secure + +################################################################################ +# go # +################################################################################ + +ENV GOPATH=$HOME/go +ENV GOBIN=$GOPATH/bin +ENV PATH=$PATH:$GOBIN + +################################################################################ +# Sanity checks # +################################################################################ -# Install Rust for the coder user via rustup (multi-arch) -RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path -ENV PATH=$PATH:/home/coder/.cargo/bin +RUN brew --version && \ + mise --version && \ + go version && \ + node -v && npm -v && yarn -v && pnpm -v && fnm --version && \ + uv --version && python3 --version && \ + cargo -V && cargo nextest --version && \ + ruby --version && \ + java -version && gradle --version && mvn --version && \ + just --version && tofu version