# Container CLI Command Reference Note: Command availability may vary depending on host operating system and macOS version. ## Core Commands ### `container run` Runs a container from an image. If a command is provided, it will execute inside the container; otherwise the image's default command runs. By default the container runs in the foreground and STDIN remains closed unless `-i`/`--interactive` is specified. **Usage** ```bash container run [OPTIONS] IMAGE [COMMAND] [ARG...] ``` **Options** * **Process and resources** * `-w, --cwd, --workdir `: Current working directory for the container * `-e, --env `: Set environment variables * `--env-file `: Read in a file of environment variables * `--uid `: Set the uid for the process * `--gid `: Set the gid for the process * `-i, --interactive`: Keep Stdin open even if not attached * `-t, --tty`: Open a tty with the process * `-u, --user `: Set the user for the process * `-c, --cpus `: Number of CPUs to allocate to the container * `-m, --memory `: Amount of memory in bytes, kilobytes (K), megabytes (M), or gigabytes (G) for the container, with MB granularity (for example, 1024K will result in 1MB being allocated for the container) * **Container management** * `-d, --detach`: Run the container and detach from the process * `--entrypoint `: Override the entrypoint of the image * `--mount `: Add a mount to the container (type=<>,source=<>,target=<>,readonly) * `-p, --publish `: Publish a port from container to host (format: [host-ip:]host-port:container-port[/protocol]) * `--publish-socket `: Publish a socket from container to host (format: host_path:container_path) * `--tmpfs `: Add a tmpfs mount to the container at the given path * `--name `: Assign a name to the container. If excluded will be a generated UUID * `--remove, --rm`: Remove the container after it stops * `--os `: Set OS if image can target multiple operating systems (default: linux) * `-a, --arch `: Set arch if image can target multiple architectures (default: arm64) * `-v, --volume `: Bind mount a volume into the container * `-k, --kernel `: Set a custom kernel path * `--network `: Attach the container to a network * `--cidfile `: Write the container ID to the path provided * `--no-dns`: Do not configure DNS in the container * `--dns `: DNS nameserver IP address * `--dns-domain `: Default DNS domain * `--dns-search `: DNS search domains * `--dns-option `: DNS options * `-l, --label