Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.92 KB

image-process.md

File metadata and controls

49 lines (38 loc) · 1.92 KB

Injected OCI image startup

StartRequest.inject_entrypoint is the absolute in-sandbox path where sandboxd injects an OCI or Nydus image's startup process configuration. An empty string disables injection. A non-empty value is valid only when the sandbox rootfs type is IMAGE; it does not change the sandbox's own command or lifecycle.

The image manager extracts Entrypoint, Cmd, WorkingDir, and User from the OCI image config. sandboxd applies Docker's effective argv rule:

  • a non-empty Entrypoint is followed by all Cmd elements;
  • without Entrypoint, Cmd is the complete argv;
  • when both are empty, args is an empty array.

Array elements are preserved exactly. sandboxd does not invoke a shell, split strings, or expand environment variables. An empty working directory becomes /.

When the option is enabled, sandboxd atomically writes this versioned JSON in the sandbox's private sandbox-files directory:

{
  "version": 1,
  "args": ["/usr/local/bin/docker-entrypoint.sh", "server"],
  "cwd": "/app",
  "user": "1000:1000"
}

The JSON file is bind-mounted read-only at the exact path supplied in inject_entrypoint, for example:

inject_entrypoint: "/run/yuanrong/image-process.json"

The path must be an absolute, canonical file path and cannot be /. User mounts that cover the configured path are rejected. sandboxd does not add a discovery environment variable; the in-sandbox runtime owns how it discovers the path.

The in-sandbox runtime owns process execution and waiting. It must reject unsupported versions, apply cwd and user, and cache the child's terminal status. The child exiting does not terminate the sandbox or disable later exec and file operations.

OCI and Nydus caches persist the extracted metadata. Records created by older sandboxd versions are upgraded lazily only when inherited startup is requested, so ordinary cached image mounts remain usable without registry access.