From d4e03163e549539589ebd2190405fe13a2e60790 Mon Sep 17 00:00:00 2001 From: Tomer Iwan Date: Mon, 22 Jun 2026 09:15:12 +0200 Subject: [PATCH 1/2] feat: add micromamba with multi-arch support (amd64 + arm64) Pins MICROMAMBA_VERSION="2.8.1-0" and installs the static binary from GitHub releases, selecting linux-64 or linux-aarch64 via /etc/arch_vars so the image builds correctly on both x86_64 hosts and Apple Silicon Macs. Sets MAMBA_ROOT_PREFIX and runs micromamba shell init to wire the activation hook into ~/.bashrc at build time. --- .devcontainer/Dockerfile | 18 ++++++++++++++++++ .devcontainer/post-create.sh | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1b4e8c7..bb9d476 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -11,6 +11,7 @@ ARG NEOVIM_VERSION="0.11.6" ARG STARSHIP_VERSION="1.24.2" ARG UV_VERSION="0.11.1" ARG ZOXIDE_VERSION="0.9.9" +ARG MICROMAMBA_VERSION="2.8.1-0" # ───────────────────────────────────────────────────────────────────────────── # Resolve build architecture once; all subsequent RUN steps source /etc/arch_vars. @@ -154,6 +155,18 @@ RUN apt-get update && \ libasound2 libx11-6 libxext6 && \ rm -rf /var/lib/apt/lists/* +# Install micromamba (static binary; conda-compatible environment manager) +# micromamba uses its own arch naming: linux-64 (amd64) / linux-aarch64 (arm64) +RUN set -eux; . /etc/arch_vars; \ + case "$ARCH_DEB" in \ + arm64) MAMBA_ARCH="linux-aarch64" ;; \ + *) MAMBA_ARCH="linux-64" ;; \ + esac; \ + curl -fLo /usr/local/bin/micromamba \ + "https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${MAMBA_ARCH}"; \ + chmod +x /usr/local/bin/micromamba; \ + micromamba --version + # Create non-root dev user ARG USERNAME=dev ARG UID=1000 @@ -197,6 +210,11 @@ ENV CLAUDE_CODE_USE_FOUNDRY=1 \ ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6 \ ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-6 +ENV MAMBA_ROOT_PREFIX="/home/${USERNAME}/micromamba" + +# Wire micromamba shell hook into ~/.bashrc (appends eval block) +RUN micromamba shell init --shell bash --root-prefix ~/micromamba + # Install OpenCode CLI (unpinned: install script does not expose a version flag) RUN curl -fsSL https://opencode.ai/install | bash diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index baaed38..26c289b 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -9,7 +9,7 @@ npx --yes skills add cedanl/.github --skill '*' -a claude-code -a opencode -a pi # Verify key CLIs are available (all installed via Dockerfile) echo "✅ CLIs available:" -for cli in nvim opencode claude uv starship zoxide node npm csvlens; do +for cli in nvim opencode claude uv starship zoxide node npm csvlens micromamba; do which "$cli" 2>/dev/null && echo " ✅ $cli: $(which $cli)" || echo " ⚠️ $cli: missing" done From 0eb178df6a0354e936280772fca09ed9634622b7 Mon Sep 17 00:00:00 2001 From: Tomer Iwan Date: Mon, 22 Jun 2026 09:17:30 +0200 Subject: [PATCH 2/2] refactor: move ARCH_MAMBA into /etc/arch_vars resolution block Keeps the single-source-of-truth pattern: all arch name mappings live in one place at the top of the Dockerfile, and every install step just sources /etc/arch_vars without needing its own case statement. --- .devcontainer/Dockerfile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index bb9d476..400ebdc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -17,14 +17,15 @@ ARG MICROMAMBA_VERSION="2.8.1-0" # Resolve build architecture once; all subsequent RUN steps source /etc/arch_vars. # ARCH_DEB : amd64 | arm64 (used by .deb packages and simple linux-* binaries) # ARCH_TAR : x86_64 | aarch64 (used by *-unknown-linux-* tarballs) -# ARCH_NVIM: x86_64 | arm64 (lazygit + neovim use this mixed naming) +# ARCH_NVIM: x86_64 | arm64 (lazygit + neovim use this mixed naming) +# ARCH_MAMBA: linux-64 | linux-aarch64 (micromamba release naming) ARG TARGETARCH RUN case "${TARGETARCH:-amd64}" in \ - arm64) ARCH_DEB=arm64; ARCH_TAR=aarch64; ARCH_NVIM=arm64 ;; \ - *) ARCH_DEB=amd64; ARCH_TAR=x86_64; ARCH_NVIM=x86_64 ;; \ + arm64) ARCH_DEB=arm64; ARCH_TAR=aarch64; ARCH_NVIM=arm64; ARCH_MAMBA=linux-aarch64 ;; \ + *) ARCH_DEB=amd64; ARCH_TAR=x86_64; ARCH_NVIM=x86_64; ARCH_MAMBA=linux-64 ;; \ esac && \ - printf 'ARCH_DEB=%s\nARCH_TAR=%s\nARCH_NVIM=%s\n' \ - "$ARCH_DEB" "$ARCH_TAR" "$ARCH_NVIM" > /etc/arch_vars + printf 'ARCH_DEB=%s\nARCH_TAR=%s\nARCH_NVIM=%s\nARCH_MAMBA=%s\n' \ + "$ARCH_DEB" "$ARCH_TAR" "$ARCH_NVIM" "$ARCH_MAMBA" > /etc/arch_vars # Install all system dependencies first (including gnupg for eza/qsv repos) RUN apt-get update && \ @@ -156,14 +157,9 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Install micromamba (static binary; conda-compatible environment manager) -# micromamba uses its own arch naming: linux-64 (amd64) / linux-aarch64 (arm64) RUN set -eux; . /etc/arch_vars; \ - case "$ARCH_DEB" in \ - arm64) MAMBA_ARCH="linux-aarch64" ;; \ - *) MAMBA_ARCH="linux-64" ;; \ - esac; \ curl -fLo /usr/local/bin/micromamba \ - "https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${MAMBA_ARCH}"; \ + "https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${ARCH_MAMBA}"; \ chmod +x /usr/local/bin/micromamba; \ micromamba --version