Linux command
runc 命令
网络
需要网络或远程资源。
常用示例
Run container
runc run [container-id]
Create container
runc create [container-id]
Start container
runc start [container-id]
List containers
runc list
Kill container
runc kill [container-id]
Delete container
runc delete [container-id]
Execute command in running container
runc exec [container-id] [command]
Show container state
runc state [container-id]
Generate OCI spec file
runc spec
Show processes running in container
runc ps [container-id]
说明
runc is a CLI tool for spawning and running containers according to the OCI specification. It's the reference implementation of the Open Container Initiative runtime specification. The tool provides low-level container runtime functionality, used by Docker, containerd, and other container platforms.
参数
- run _id_
- Create and start container.
- create _id_
- Create container.
- start _id_
- Start created container.
- list
- List containers.
- state _id_
- Output container state.
- kill _id_ _signal_
- Send signal to container.
- delete _id_
- Delete container.
- exec _id_ _cmd_
- Execute new process inside container.
- pause _id_
- Suspend all processes inside container.
- resume _id_
- Resume previously paused processes.
- ps _id_
- Show processes running inside container.
- events _id_
- Display container events (OOM, CPU, memory, I/O stats).
- update _id_
- Update container resource constraints.
- checkpoint _id_
- Checkpoint a running container.
- restore _id_
- Restore container from a previous checkpoint.
- spec
- Generate new OCI spec file (config.json).
- --root _dir_
- Root directory for container state storage (should be on tmpfs).
- --debug
- Enable debug logging.
- --log _path_
- Set log file path (default: stderr).
- --log-format _text|json_
- Set log format (default: text).
- --systemd-cgroup
- Enable systemd cgroup support.
- --rootless _true|false|auto_
- Enable or disable rootless mode (default: auto).
FAQ
What is the runc command used for?
runc is a CLI tool for spawning and running containers according to the OCI specification. It's the reference implementation of the Open Container Initiative runtime specification. The tool provides low-level container runtime functionality, used by Docker, containerd, and other container platforms.
How do I run a basic runc example?
Run `runc run [container-id]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does run _id_ do in runc?
Create and start container.