Skip to content

Commit c51b8cc

Browse files
committed
refactor: generalize container build tooling for Docker and Podman compatibility
Rename Docker-branded env vars, scripts, and mise tasks to generic container terminology while preserving full backwards compatibility. - Add ce_resolve_containerfile() helper to container-engine.sh that auto-detects Containerfile.X or Dockerfile.X (Containerfile preferred) - Rename build scripts from docker-* to container-* (4 files) - Add CONTAINER_* env var equivalents with DOCKER_* fallbacks (9 vars) - Create tasks/container.toml with canonical build:container:* task names - Convert tasks/docker.toml to pure alias file for backwards compat - Update all cross-references in shell scripts, TOML task files, CI workflow, architecture docs, and agent files - Fix pre-existing bug: remove exec keyword from container-build-ci.sh (exec does not work with bash functions) Closes NVIDIA#968 Signed-off-by: Adam Miller <[email protected]> refactor: move deploy/docker to deploy/container Rename the build artifact directory from deploy/docker to deploy/container to reflect engine-neutral naming (Docker and Podman are both supported). Updates all 37 references across CI workflows, task scripts, Skaffold config, Dockerfiles, docs, and .gitignore. refactor: replace docker.toml shims with native mise aliases in container.toml Use mise's alias property on each build:container:* task instead of maintaining a separate docker.toml file with depends-based redirects. Adds build:container:prebuilt (migrated from docker.toml) and drops docker.toml entirely.
1 parent 5045b9c commit c51b8cc

36 files changed

Lines changed: 493 additions & 328 deletions

‎.claude/agent-memory/arch-doc-writer/MEMORY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
- Four runtime images: sandbox (5 stages), gateway (2 stages), cluster (k3s base), pki-job (Alpine)
6363
- Two build-only images: python-wheels (Linux multi-arch), python-wheels-macos (osxcross cross-compile)
6464
- CI image: Dockerfile.ci (Ubuntu 24.04, pre-installs docker/buildx/aws/kubectl/helm/mise/uv/sccache/socat)
65-
- Cross-compilation: `deploy/docker/cross-build.sh` shared by sandbox + gateway Dockerfiles
65+
- Cross-compilation: `deploy/container/cross-build.sh` shared by sandbox + gateway Dockerfiles
6666
- Sandbox image has coding-agents stage: Claude CLI (native installer), OpenCode, Codex (npm)
6767
- Helm chart deploys a StatefulSet (NOT Deployment), PVC 1Gi at /var/openshell
6868
- Cluster image does NOT bundle image tarballs -- components pulled at runtime from distribution registry

‎.github/workflows/ci-image.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'deploy/docker/Dockerfile.ci'
7+
- 'deploy/container/Dockerfile.ci'
88
- 'mise.toml'
99
- 'mise.lock'
1010
- 'tasks/**'
@@ -72,7 +72,7 @@ jobs:
7272
--cache-to "type=gha,mode=max,scope=ci-image-${{ matrix.arch }}" \
7373
--push \
7474
-t "$ARCH_IMAGE" \
75-
-f deploy/docker/Dockerfile.ci \
75+
-f deploy/container/Dockerfile.ci \
7676
.
7777
7878
- name: Smoke check CI image

‎.github/workflows/docker-build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
set -euo pipefail
223223
binary="${{ needs.resolve.outputs.binary_name }}"
224224
download_dir="prebuilt-rust-binary"
225-
stage="deploy/docker/.build/prebuilt-binaries/${{ matrix.arch }}"
225+
stage="deploy/container/.build/prebuilt-binaries/${{ matrix.arch }}"
226226
found="$(find "$download_dir" -type f -name "$binary" -print -quit)"
227227
if [[ -z "$found" ]]; then
228228
echo "missing downloaded artifact file: $binary" >&2
@@ -238,7 +238,7 @@ jobs:
238238
DOCKER_BUILDER: openshell
239239
run: |
240240
set -euo pipefail
241-
mise exec -- tasks/scripts/docker-build-image.sh "${{ inputs.component }}" \
241+
mise exec -- tasks/scripts/container-build-image.sh "${{ inputs.component }}" \
242242
--cache-from "type=gha,scope=${{ inputs.component }}-${{ matrix.arch }}" \
243243
--cache-to "type=gha,mode=max,scope=${{ inputs.component }}-${{ matrix.arch }}"
244244

‎.github/workflows/driver-vm-macos.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
run: |
194194
set -euo pipefail
195195
docker buildx build \
196-
--file deploy/docker/Dockerfile.driver-vm-macos \
196+
--file deploy/container/Dockerfile.driver-vm-macos \
197197
--build-arg OPENSHELL_CARGO_VERSION="${{ inputs['cargo-version'] }}" \
198198
--build-arg OPENSHELL_IMAGE_TAG="${{ inputs['image-tag'] }}" \
199199
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \

‎.github/workflows/release-dev.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ jobs:
352352
run: |
353353
set -euo pipefail
354354
docker buildx build \
355-
--file deploy/docker/Dockerfile.cli-macos \
355+
--file deploy/container/Dockerfile.cli-macos \
356356
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
357357
--build-arg OPENSHELL_IMAGE_TAG=dev \
358358
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \
@@ -512,7 +512,7 @@ jobs:
512512
run: |
513513
set -euo pipefail
514514
docker buildx build \
515-
--file deploy/docker/Dockerfile.gateway-macos \
515+
--file deploy/container/Dockerfile.gateway-macos \
516516
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
517517
--build-arg OPENSHELL_IMAGE_TAG=dev \
518518
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \

‎.github/workflows/release-tag.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ jobs:
385385
run: |
386386
set -euo pipefail
387387
docker buildx build \
388-
--file deploy/docker/Dockerfile.cli-macos \
388+
--file deploy/container/Dockerfile.cli-macos \
389389
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
390390
--build-arg OPENSHELL_IMAGE_TAG="${{ needs.compute-versions.outputs.semver }}" \
391391
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \
@@ -631,7 +631,7 @@ jobs:
631631
run: |
632632
set -euo pipefail
633633
docker buildx build \
634-
--file deploy/docker/Dockerfile.gateway-macos \
634+
--file deploy/container/Dockerfile.gateway-macos \
635635
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
636636
--build-arg OPENSHELL_IMAGE_TAG="${{ needs.compute-versions.outputs.semver }}" \
637637
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ _build/
185185
rootfs/
186186

187187
# Docker build artifacts (image tarballs, packaged helm charts)
188-
deploy/docker/.build/
188+
deploy/container/.build/
189189

190190
# Helm subchart tarballs (regenerated by `helm dependency build`)
191191
deploy/helm/openshell/charts/

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ ocsf_emit!(event);
178178

179179
- Always use `uv` for Python commands (e.g., `uv pip install`, `uv run`, `uv venv`)
180180

181-
## Docker
181+
## Containers
182182

183-
- Always prefer `mise` commands over direct docker builds (e.g., `mise run docker:build` instead of `docker build`)
183+
- Always prefer `mise` commands over direct container builds (e.g., `mise run build:container` instead of `docker build` or `podman build`)
184184

185185
## Cluster Infrastructure Changes
186186

‎architecture/build.md‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ OpenShell builds these main artifacts:
1212
|---|---|
1313
| Gateway binary | `crates/openshell-server` |
1414
| CLI package and Python SDK | `python/openshell` plus Rust binaries where packaged |
15-
| Gateway container image | `deploy/docker/Dockerfile.gateway` |
16-
| Supervisor container image | `deploy/docker/Dockerfile.supervisor` |
15+
<<<<<<< HEAD
16+
| Gateway and supervisor container images | `deploy/container/Dockerfile.images` |
1717
| Helm chart | `deploy/helm/openshell` |
1818
| VM driver/runtime assets | `crates/openshell-driver-vm` |
1919
| Published docs site | `docs/` rendered by Fern config in `fern/` |
@@ -31,12 +31,10 @@ glibc 2.31 floor.
3131

3232
## Container Builds
3333

34-
The Docker image pipeline is a two-step flow: build the Rust binary natively
35-
for the target architecture, then assemble the container image from the
36-
prebuilt binary. The gateway image is built from `deploy/docker/Dockerfile.gateway`
37-
and the supervisor image from `deploy/docker/Dockerfile.supervisor`. Neither
38-
Dockerfile compiles Rust — both copy a staged binary out of
39-
`deploy/docker/.build/prebuilt-binaries/<arch>/` into the final image.
34+
The container image pipeline stages prebuilt Rust binaries, then builds container
35+
images from `deploy/container/Dockerfile.images`. CI builds native artifacts on the
36+
target architecture, stages them under `deploy/container/.build/`, and then uses
37+
Buildx to publish per-architecture images and multi-architecture tags.
4038

4139
Binary staging is driven by `tasks/scripts/stage-prebuilt-binaries.sh`. Gateway
4240
binaries use `cargo zigbuild` with GNU targets pinned to glibc 2.31, including
@@ -59,7 +57,6 @@ Runtime layout:
5957
Static linkage is required because the image is mounted/extracted into
6058
sandbox environments (Docker extraction, Podman image volumes, Kubernetes
6159
init-container copy-self) and cannot rely on a dynamic loader.
62-
6360
Gateway image builds bake the corresponding supervisor image tag into the
6461
gateway binary so Docker sandboxes do not depend on `:latest` by default.
6562
Package formulas also pin Docker supervisor extraction to the matching release

‎crates/openshell-driver-podman/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ sequenceDiagram
8686
C->>C: entrypoint: /opt/openshell/bin/openshell-sandbox
8787
```
8888

89-
The supervisor image from `deploy/docker/Dockerfile.supervisor` copies the static
90-
`openshell-sandbox` binary to `/openshell-sandbox`.
89+
The `supervisor` target in `deploy/container/Dockerfile.images` copies the
90+
`openshell-sandbox` binary to `/openshell-sandbox` in the supervisor image.
9191
Mounting that image at `/opt/openshell/bin` makes the binary available as
9292
`/opt/openshell/bin/openshell-sandbox`.
9393

@@ -346,4 +346,4 @@ matter compared to cluster or rootful runtimes:
346346
netns, proxy, and relay behavior shared by all drivers.
347347
- Container engine abstraction: `tasks/scripts/container-engine.sh` for
348348
build/deploy support across Docker and Podman.
349-
- Supervisor image build: `deploy/docker/Dockerfile.supervisor`.
349+
- Supervisor image build: `deploy/container/Dockerfile.images`.

0 commit comments

Comments
 (0)