Skip to content

fix(sandbox): use wrapper-safe docker container create/run argv - #507

Merged
rschardosin merged 1 commit into
mainfrom
fix/sandbox-docker-wrapper-safe-argv
Sep 8, 2026
Merged

fix(sandbox): use wrapper-safe docker container create/run argv#507
rschardosin merged 1 commit into
mainfrom
fix/sandbox-docker-wrapper-safe-argv

Conversation

@rschardosin

Copy link
Copy Markdown
Contributor

Summary

astonish sandbox init failed on hosts whose /usr/bin/docker is an LXC AppArmor wrapper. The wrapper rewrites top-level create/run and treats the first non-dash token as the image, so docker create --name astonish-seed-base IMAGE became invalid reference format (exit 125).

Seed (SeedBaseLayerFromImage) and session start (dockerRunArgs) now use management-command form plus --flag=value:

  • docker container create --name=… --entrypoint=/bin/true IMAGE
  • docker container run --detach --name=… --volume=… IMAGE

Vanilla Docker, Podman, and this wrapper all accept that form. Unit tests cover overlay argv, seed argv, and a model of the LXC rewrite so split --name value stays rejected.

Verified on this host: ./astonish sandbox init completed and @base/rootfs is a real rootfs (bin/sh present).

Test plan

  • go test ./pkg/sandbox/docker (wrapper-safe argv tests)
  • golangci-lint v2.12.2 on commit
  • Live ./astonish sandbox init on a host with the LXC /usr/bin/docker wrapper
  • astonish sandbox init on a host with vanilla Docker (no wrapper)
  • Start a sandbox session after init (docker container run path)

LXC AppArmor docker wrappers rewrite top-level create/run and treat the
first non-dash token as the image, so `docker create --name value IMAGE`
failed with "invalid reference format" during sandbox init.

Seed and session now use `docker container create|run` with --flag=value
so vanilla Docker, Podman, and those wrappers all succeed.
@rschardosin
rschardosin merged commit a8e71d1 into main Sep 8, 2026
5 checks passed
@rschardosin
rschardosin deleted the fix/sandbox-docker-wrapper-safe-argv branch September 8, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants