1- # syntax=docker/dockerfile:1.4
1+ # syntax=docker/dockerfile:1
22
33# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44# SPDX-License-Identifier: Apache-2.0
@@ -20,9 +20,9 @@ ENV DEBIAN_FRONTEND=noninteractive \
2020WORKDIR /sandbox
2121
2222# Core system dependencies
23- # python3.13 + pip: agent scripting and SDK usage (deadsnakes PPA for Noble)
2423# iproute2: network namespace management (ip netns, veth pairs)
2524# dnsutils: dig, nslookup
25+ # Python is managed entirely by uv (see devtools stage).
2626RUN apt-get update && apt-get install -y --no-install-recommends \
2727 ca-certificates \
2828 curl \
@@ -33,17 +33,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3333 netcat-openbsd \
3434 openssh-sftp-server \
3535 procps \
36- software-properties-common \
3736 traceroute \
38- && add-apt-repository -y ppa:deadsnakes/ppa \
39- && apt-get update \
40- && apt-get install -y --no-install-recommends \
41- python3.13 \
42- python3.13-venv \
43- python3.13-dev \
44- && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 \
45- && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1 \
46- && update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1 \
4737 && rm -rf /var/lib/apt/lists/*
4838
4939# Create supervisor and sandbox users/groups
@@ -57,25 +47,32 @@ FROM system AS devtools
5747# Pin to a specific patch version for reproducible builds.
5848# CVE-2026-21637, CVE-2025-59466, CVE-2025-59465, CVE-2025-55131 affect
5949# Node.js <= 22.22.1. Update to 22.23.0+ when a patched release ships.
50+ #
51+ # npm is upgraded to v11 in the same layer to avoid caching the old npm.
52+ # npm 11 ships tar@^7.5.9, fixing tar@6.2.1 vulns bundled in npm 10
53+ # (GHSA-r6q2-hw4h-h46w, GHSA-8qq5-rm4j-mr97, GHSA-83g3-92jg-28cx,
54+ # GHSA-34x7-hfp2-rc4v, GHSA-qffp-2rhf-9h96).
6055RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
6156 apt-get install -y --no-install-recommends \
6257 build-essential \
6358 git \
6459 nodejs=22.22.1-1nodesource1 \
6560 vim-tiny \
6661 nano \
67- && rm -rf /var/lib/apt/lists/*
68-
69- # Upgrade npm to v11 which ships tar@^7.5.9 (fixes tar@6.2.1 vulns bundled in
70- # npm 10: GHSA-r6q2-hw4h-h46w, GHSA-8qq5-rm4j-mr97, GHSA-83g3-92jg-28cx,
71- # GHSA-34x7-hfp2-rc4v, GHSA-qffp-2rhf-9h96).
72- RUN npm install -g npm@11.11.0
73-
74- # Fix transitive tar and @hono/node-server vulnerabilities
75- # (GHSA-qffp-2rhf-9h96, GHSA-9ppj-qmqm-q256, GHSA-8qq5-rm4j-mr97,
76- # GHSA-r6q2-hw4h-h46w, GHSA-34x7-hfp2-rc4v, GHSA-83g3-92jg-28cx,
77- # GHSA-wc8c-qw6v-h7f6).
78- RUN npm install -g tar@7.5.11 @hono/node-server@1.19.11
62+ && rm -rf /var/lib/apt/lists/* \
63+ && npm install -g npm@11.11.0
64+
65+ # Global npm packages — pinned for reproducibility.
66+ # tar + @hono/node-server: transitive vuln fixes
67+ # (GHSA-qffp-2rhf-9h96, GHSA-9ppj-qmqm-q256, GHSA-8qq5-rm4j-mr97,
68+ # GHSA-r6q2-hw4h-h46w, GHSA-34x7-hfp2-rc4v, GHSA-83g3-92jg-28cx,
69+ # GHSA-wc8c-qw6v-h7f6).
70+ # opencode-ai + @openai/codex: agent CLIs.
71+ RUN npm install -g \
72+ tar@7.5.11 \
73+ @hono/node-server@1.19.11 \
74+ opencode-ai@1.2.18 \
75+ @openai/codex@0.111.0
7976
8077# GitHub CLI
8178RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
@@ -90,12 +87,14 @@ RUN curl -fsSL https://claude.ai/install.sh | bash \
9087 && cp /root/.local/bin/claude /usr/local/bin/claude \
9188 && chmod 755 /usr/local/bin/claude
9289
93- # Install OpenCode CLI and Codex CLI (OpenAI) with pinned versions for
94- # reproducible builds.
95- RUN npm install -g opencode-ai@1.2.18 @openai/codex@0.111.0
96-
97- # uv (Python package manager) — pinned for reproducibility
90+ # uv (Python package/project manager) — pinned for reproducibility.
91+ # uv manages the Python toolchain; no system Python packages are needed.
9892COPY --from=ghcr.io/astral-sh/uv:0.10.8 /uv /usr/local/bin/uv
93+ ENV UV_PYTHON_INSTALL_DIR="/sandbox/.uv/python"
94+ RUN uv python install 3.13 && \
95+ ln -s $(uv python find 3.13) /usr/local/bin/python3 && \
96+ ln -s $(uv python find 3.13) /usr/local/bin/python && \
97+ uv cache clean
9998
10099# Final base image
101100FROM devtools AS final
@@ -105,11 +104,10 @@ FROM devtools AS final
105104# VIRTUAL_ENV and UV_PYTHON_INSTALL_DIR are also exported in .bashrc
106105# so that login shell sessions (interactive and exec) see them.
107106ENV PATH="/sandbox/.venv/bin:/usr/local/bin:/usr/bin:/bin" \
108- VIRTUAL_ENV="/sandbox/.venv" \
109- UV_PYTHON_INSTALL_DIR="/sandbox/.uv/python"
107+ VIRTUAL_ENV="/sandbox/.venv"
110108
111- # Ensure policy directory exists
112- RUN mkdir -p /etc/navigator
109+ # Default sandbox network / filesystem policy
110+ COPY policy.yaml /etc/navigator/policy.yaml
113111
114112# Copy custom skills into the image.
115113# To add a skill, create a subdirectory under sandboxes/base/skills/
@@ -118,11 +116,12 @@ RUN mkdir -p /etc/navigator
118116COPY skills/ /sandbox/.agents/skills/
119117
120118# Set up sandbox user home directory
121- RUN mkdir -p /sandbox/.agents/skills /sandbox/. claude/skills && \
122- # Create a writable venv that inherits all system packages .
123- # Sandbox users can `pip install` or `uv pip install` into
119+ RUN mkdir -p /sandbox/.claude/skills && \
120+ # Create a writable venv using uv-managed Python 3.13 .
121+ # Sandbox users can `uv pip install` ( or `pip install`) into
124122 # this venv without touching the base image layer.
125- uv venv --python /usr/bin/python3.13 --seed --system-site-packages /sandbox/.venv && \
123+ uv venv --python 3.13 --seed /sandbox/.venv && \
124+ uv cache clean && \
126125 chown -R sandbox:sandbox /sandbox/.venv && \
127126 # Minimal shell init files so interactive and non-interactive shells
128127 # get a sane PATH and prompt. Without these, bash sources nothing
0 commit comments