review: remove security-boundary note, move podman into nested-containers layer
test / integration-docker (pull_request) Successful in 19s
test / unit (pull_request) Failing after 39s
lint / lint (push) Successful in 56s
tracker-policy-pr / check-pr (pull_request) Failing after 13m51s
test / integration-firecracker (pull_request) Failing after 14m1s
test / coverage (pull_request) Has been skipped
test / publish-infra (pull_request) Has been skipped
test / integration-docker (pull_request) Successful in 19s
test / unit (pull_request) Failing after 39s
lint / lint (push) Successful in 56s
tracker-policy-pr / check-pr (pull_request) Failing after 13m51s
test / integration-firecracker (pull_request) Failing after 14m1s
test / coverage (pull_request) Has been skipped
test / publish-infra (pull_request) Has been skipped
- Drop the module-level paragraph emphasizing the single-UID security boundary (#issuecomment-5010): redundant given the safe environment. - Move `podman` from each agent image (claude, codex, pi) into the `build_image` derived layer so bottles without `nested_containers` pay no image-size cost (#issuecomment-5013). - Update `build_image` docstring and inline comments to reflect the move. - Add TODO(#394) noting the planned docker-layer abstraction refactor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,11 +19,6 @@ what would send podman down the `newuidmap` path that cannot work here.
|
|||||||
The agent still talks to `docker` and `docker compose`; those speak to
|
The agent still talks to `docker` and `docker compose`; those speak to
|
||||||
podman's Docker-compatible API socket, so nothing in the agent's habits
|
podman's Docker-compatible API socket, so nothing in the agent's habits
|
||||||
changes.
|
changes.
|
||||||
|
|
||||||
Nested containers run *within* the bottle boundary, not inside a new one: the
|
|
||||||
single-UID mapping means `root` in a nested container is the agent user
|
|
||||||
outside it. This is for build and test workloads, not for sandboxing
|
|
||||||
untrusted code.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -65,9 +60,11 @@ def build_image(
|
|||||||
) -> str:
|
) -> str:
|
||||||
"""Layer the nested-container tooling onto an already-built agent image.
|
"""Layer the nested-container tooling onto an already-built agent image.
|
||||||
|
|
||||||
Only what the flag is meant to gate lands here. Podman itself is already
|
Podman and its networking stack live here rather than in the base agent
|
||||||
in every built-in agent image (issue #451); the storage/network helpers,
|
images so that bottles without the flag pay no image-size cost.
|
||||||
the Docker CLI, and the compose plugin are the ~100MB this flag buys.
|
|
||||||
|
# TODO(#394): replace this hand-rolled Dockerfile with a docker-layer
|
||||||
|
# abstraction once that infrastructure exists.
|
||||||
"""
|
"""
|
||||||
image = f"{base_image}{IMAGE_SUFFIX}"
|
image = f"{base_image}{IMAGE_SUFFIX}"
|
||||||
init_script = Path(__file__).with_name("nested-containers-init.sh")
|
init_script = Path(__file__).with_name("nested-containers-init.sh")
|
||||||
@@ -82,9 +79,11 @@ def build_image(
|
|||||||
"COPY --from=docker_cli /usr/local/libexec/docker/cli-plugins/"
|
"COPY --from=docker_cli /usr/local/libexec/docker/cli-plugins/"
|
||||||
"docker-compose /usr/local/libexec/docker/cli-plugins/docker-compose\n"
|
"docker-compose /usr/local/libexec/docker/cli-plugins/docker-compose\n"
|
||||||
"RUN apt-get update \\\n"
|
"RUN apt-get update \\\n"
|
||||||
# podman 5's networking stack, installed explicitly because the
|
# podman 5's networking stack, installed explicitly because
|
||||||
# base image's `--no-install-recommends` podman does not pull it
|
# --no-install-recommends omits it and each missing piece fails
|
||||||
# in and each piece fails at a different, misleading layer:
|
# at a different, misleading layer:
|
||||||
|
# podman -> moved here from the base agent images so that
|
||||||
|
# bottles without nested_containers pay no cost
|
||||||
# passt -> `pasta`, the default rootless netns helper
|
# passt -> `pasta`, the default rootless netns helper
|
||||||
# (podman 4 used slirp4netns); without it
|
# (podman 4 used slirp4netns); without it
|
||||||
# nothing starts: "could not find pasta"
|
# nothing starts: "could not find pasta"
|
||||||
@@ -95,7 +94,7 @@ def build_image(
|
|||||||
# looks healthy
|
# looks healthy
|
||||||
# slirp4netns stays as the documented fallback for pasta.
|
# slirp4netns stays as the documented fallback for pasta.
|
||||||
" && apt-get install -y --no-install-recommends "
|
" && apt-get install -y --no-install-recommends "
|
||||||
"aardvark-dns fuse-overlayfs netavark nftables passt "
|
"aardvark-dns fuse-overlayfs netavark nftables passt podman "
|
||||||
"slirp4netns uidmap \\\n"
|
"slirp4netns uidmap \\\n"
|
||||||
" && rm -rf /var/lib/apt/lists/* \\\n"
|
" && rm -rf /var/lib/apt/lists/* \\\n"
|
||||||
# Deliberate: an empty subordinate range keeps podman on the
|
# Deliberate: an empty subordinate range keeps podman on the
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ RUN apt-get update \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
podman \
|
|
||||||
ripgrep \
|
ripgrep \
|
||||||
iproute2 \
|
iproute2 \
|
||||||
dnsutils \
|
dnsutils \
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ RUN apt-get update \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
podman \
|
|
||||||
procps \
|
procps \
|
||||||
ripgrep \
|
ripgrep \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ RUN apt-get update \
|
|||||||
curl \
|
curl \
|
||||||
fd-find \
|
fd-find \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
podman \
|
|
||||||
ripgrep \
|
ripgrep \
|
||||||
&& ln -s /usr/bin/fdfind /usr/local/bin/fd \
|
&& ln -s /usr/bin/fdfind /usr/local/bin/fd \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
Reference in New Issue
Block a user