id = "container"
name = "Container"
homepage = "https://github.com/apple/container"
description = "A toolset for building and running Linux containers on macOS."
executables = ["container"]
[dotfiles]
paths = ["~/.config/container/config.toml"]
secret = []
side_effect = false
[commands]
format = 1
label = "Apple container"
description = "Run a container or build an image with Apple's container CLI. Networking, mounts beyond -v, registry and resource-limit options are mostly left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.subcommand]]
path = ["run"]
label = "Run a container"
[[commands.subcommand.source]]
id = "help"
kind = "help"
revision = "container CLI version 1.6.0"
evidence = """
USAGE: container run [<options>] <image> [<arguments> ...]
-e, --env <env> Set environment variables (key=value, or just key to
-i, --interactive Keep the standard input open even if not attached
-t, --tty Open a TTY with the process
-w, --workdir, --cwd <dir>
-c, --cpus <cpus> Number of CPUs to allocate to the container
-m, --memory <memory> Amount of memory (1MiByte granularity), with optional
-d, --detach Run the container and detach from the process
--entrypoint <cmd> Override the entrypoint of the image
--name <name> Use the specified name as the container ID
-p, --publish <spec> Publish a port from container to host (format:
--rm, --remove Remove the container after it stops
-v, --volume <volume> Bind mount a volume into the container
"""
[[commands.subcommand.field]]
id = "image"
label = "Image"
type = "string"
position = 0
sources = ["help"]
[[commands.subcommand.field]]
id = "args"
label = "Command and arguments"
type = "string"
position = 1
multiple = true
sources = ["help"]
[[commands.subcommand.field]]
id = "name"
label = "Container name"
type = "string"
option = ["--name"]
sources = ["help"]
[[commands.subcommand.field]]
id = "interactive"
label = "Keep stdin open"
type = "boolean"
option = ["--interactive", "-i"]
sources = ["help"]
[[commands.subcommand.field]]
id = "tty"
label = "Allocate a TTY"
type = "boolean"
option = ["--tty", "-t"]
sources = ["help"]
[[commands.subcommand.field]]
id = "detach"
label = "Run in background"
type = "boolean"
option = ["--detach", "-d"]
sources = ["help"]
[[commands.subcommand.field]]
id = "rm"
label = "Remove after it stops"
type = "boolean"
option = ["--rm"]
sources = ["help"]
[[commands.subcommand.field]]
id = "env"
label = "Environment variables"
description = "key=value, or just key to inherit from the host."
type = "string"
option = ["--env", "-e"]
multiple = true
sources = ["help"]
[[commands.subcommand.field]]
id = "publish"
label = "Published ports"
description = "[host-ip:]host-port:container-port[/protocol]"
type = "string"
option = ["--publish", "-p"]
multiple = true
sources = ["help"]
[[commands.subcommand.field]]
id = "volume"
label = "Bind mounts"
type = "string"
option = ["--volume", "-v"]
multiple = true
sources = ["help"]
[[commands.subcommand.field]]
id = "workdir"
label = "Working directory"
type = "string"
option = ["--workdir"]
sources = ["help"]
[[commands.subcommand.field]]
id = "cpus"
label = "CPUs"
type = "integer"
option = ["--cpus", "-c"]
sources = ["help"]
[[commands.subcommand.field]]
id = "memory"
label = "Memory"
description = "Optional K, M, G, T or P suffix."
type = "string"
option = ["--memory", "-m"]
sources = ["help"]
[[commands.subcommand.task]]
id = "interactive"
label = "Interactive shell"
set = { interactive = [true], tty = [true], rm = [true] }
fields = ["image", "args", "interactive", "tty", "rm", "volume", "env"]
required = ["image"]
[[commands.subcommand.task]]
id = "background"
label = "Background service"
set = { detach = [true] }
fields = ["image", "name", "detach", "publish", "env", "volume"]
required = ["image"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["image", "args", "name", "interactive", "tty", "detach", "rm"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["env", "publish", "volume", "workdir", "cpus", "memory"]
[[commands.subcommand]]
path = ["build"]
label = "Build an image"
[[commands.subcommand.source]]
id = "help"
kind = "help"
revision = "container CLI version 1.6.0"
evidence = """
USAGE: build [<options>] [<context-dir>]
<context-dir> Build directory (default: .)
--build-arg <key=val> Set build-time variables
-f, --file <path> Path to Dockerfile
--no-cache Do not use cache
--platform <platform> Add the platform to the build (format:
-t, --tag <name> Name for the built image (default:
--target <stage> Set the target build stage
--pull Pull latest image
"""
[[commands.subcommand.field]]
id = "context"
label = "Build context"
type = "path"
position = 0
path = { kind = "directory", role = "input" }
sources = ["help"]
[[commands.subcommand.field]]
id = "tag"
label = "Image tag"
type = "string"
option = ["--tag", "-t"]
sources = ["help"]
[[commands.subcommand.field]]
id = "file"
label = "Dockerfile"
type = "path"
option = ["--file", "-f"]
path = { kind = "file", role = "input" }
sources = ["help"]
[[commands.subcommand.field]]
id = "build_arg"
label = "Build args (key=val)"
type = "string"
option = ["--build-arg"]
multiple = true
sources = ["help"]
[[commands.subcommand.field]]
id = "target"
label = "Target stage"
type = "string"
option = ["--target"]
sources = ["help"]
[[commands.subcommand.field]]
id = "platform"
label = "Platform"
type = "string"
option = ["--platform"]
sources = ["help"]
[[commands.subcommand.field]]
id = "no_cache"
label = "No cache"
type = "boolean"
option = ["--no-cache"]
sources = ["help"]
[[commands.subcommand.field]]
id = "pull"
label = "Pull latest base image"
type = "boolean"
option = ["--pull"]
sources = ["help"]
[[commands.subcommand.task]]
id = "build"
label = "Build and tag"
fields = ["context", "tag", "file", "build_arg", "target"]
required = ["tag"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["context", "tag", "file", "build_arg", "target"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["platform", "no_cache", "pull"]