[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4952":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},4952,"runc","opencontainers\u002Frunc","opencontainers","CLI tool for spawning and running containers according to the OCI specification","https:\u002F\u002Fwww.opencontainers.org\u002F",null,"Go",13271,2293,362,262,0,5,21,60,22,45,"Apache License 2.0",false,"main",true,[27,28,29],"containers","docker","oci","2026-06-12 02:01:06","# runc\n\n[![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002Fopencontainers\u002Frunc)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002Fopencontainers\u002Frunc)\n[![Go Reference](https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002Fopencontainers\u002Frunc.svg)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fopencontainers\u002Frunc)\n[![CII Best Practices](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F588\u002Fbadge)](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F588)\n[![gha\u002Fvalidate](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\u002Fworkflows\u002Fvalidate\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\u002Factions?query=workflow%3Avalidate)\n[![gha\u002Fci](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\u002Fworkflows\u002Fci\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\u002Factions?query=workflow%3Aci)\n\n## Introduction\n\n`runc` is a CLI tool for spawning and running containers on Linux according to the OCI specification.\n\n## Releases\n\nYou can find official releases of `runc` on the [release](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\u002Freleases) page.\n\nAll releases are signed by one of the keys listed in the [`runc.keyring` file in the root of this repository](runc.keyring).\n\n## Security\n\nThe reporting process and disclosure communications are outlined [here](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Forg\u002Fblob\u002Fmaster\u002FSECURITY.md).\n\n### Security Audit\nA third party security audit was performed by Cure53, you can see the full report [here](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\u002Fblob\u002Fmaster\u002Fdocs\u002FSecurity-Audit.pdf).\n\n## Building\n\n`runc` only supports Linux. See the header of [`go.mod`](.\u002Fgo.mod) for the minimally required Go version.\n\n### Pre-Requisites\n\n#### Utilities and Libraries\n\nIn addition to Go, building `runc` requires multiple utilities and libraries to be installed on your system.\n\nOn Ubuntu\u002FDebian, you can install the required dependencies with:\n\n```bash\napt update && apt install -y make gcc linux-libc-dev libseccomp-dev pkg-config git\n```\n\nOn CentOS\u002FFedora, you can install the required dependencies with:\n\n```bash\nyum install -y make gcc kernel-headers libseccomp-devel pkg-config git\n```\n\nOn Alpine Linux, you can install the required dependencies with:\n\n```bash\napk --update add bash make gcc libseccomp-dev musl-dev linux-headers git\n```\n\nThe following dependencies are optional:\n\n* `libseccomp` - only required if you enable seccomp support; to disable, see [Build Tags](#build-tags).\n* `libpathrs` - only required if you enable libpathrs support; to disable, see [Build Tags](#build-tags).\n   For notes on installing libpathrs, see [the next section](#libpathrs).\n\n##### libpathrs\n\n[libpathrs][] is a Rust library runc can optionally use for path safety. As\nmentioned in [the build tag section](#build-tags), its use is controlled with\nthe `libpathrs` build tag. runc currently requires at least libpathrs 0.2.4 in\norder to function properly.\n\nAt time of writing, very few distributions have libpathrs packages and so it is\nusually necessary to build and install it locally. For detailed installation\ninstructions, see [the upstream documentation][libpathrs-install-md], but for\ndevelopment builds the following instructions should be sufficient:\n\nlibpathrs requires Rust 1.63+ (which is available on almost any distribution,\nincluding Debian oldstable and enterprise distributions like RHEL or SLES).\nAssuming you already have `cargo` installed (as well as other libpathrs\ndependencies like `clang` and `lld`), the following steps are all that are\nreally necessary to install libpathrs:\n\n```sh\nLIBPATHRS_VERSION=0.2.4\ncurl -o - -sSL https:\u002F\u002Fgithub.com\u002Fcyphar\u002Flibpathrs\u002Freleases\u002Fdownload\u002Fv${LIBPATHRS_VERSION}\u002Flibpathrs-${LIBPATHRS_VERSION}.tar.xz | tar xvfJ -\ncd libpathrs-${LIBPATHRS_VERSION}\u002F\nmake release\nsudo .\u002Finstall.sh --prefix=\u002Fusr\u002Flocal\nsudo ldconfig\n```\n\nAs part of our CI, we make use of a custom [installation script for\nlibpathrs][libpathrs-install-script] which may be useful as a reference for\nfolks with more complicated needs. With `script\u002Fbuild-libpathrs.sh` the\ninstallation of libpathrs becomes as simple as:\n\n```sh\nsudo .\u002Fscript\u002Fbuild-libpathrs.sh \"$LIBPATHRS_VERSION\" \u002Fusr\u002Flocal\nsudo ldconfig\n```\n\nHowever, please note that this installation script is **completely\nunsupported** and is not really intended for general use (it includes some\nworkarounds for issues in our CI which will no longer be necessary once\nlibpathrs has distribution packages we can use).\n\n[libpathrs]: https:\u002F\u002Fgithub.com\u002Fcyphar\u002Flibpathrs\n[libpathrs-install-md]: https:\u002F\u002Fgithub.com\u002Fcyphar\u002Flibpathrs\u002Fblob\u002Fmain\u002FINSTALL.md\n[libpathrs-install-script]: .\u002Fscript\u002Fbuild-libpathrs.sh\n[gha-test-yml]: .\u002F.github\u002Fworkflows\u002Ftest.yml\n\n### Build\n\n```bash\n# create a 'github.com\u002Fopencontainers' in your GOPATH\u002Fsrc\ncd github.com\u002Fopencontainers\ngit clone https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Frunc\ncd runc\n\nmake\nsudo make install\n```\n\nYou can also use `go get` to install to your `GOPATH`, assuming that you have a `github.com` parent folder already created under `src`:\n\n```bash\ngo get github.com\u002Fopencontainers\u002Frunc\ncd $GOPATH\u002Fsrc\u002Fgithub.com\u002Fopencontainers\u002Frunc\nmake\nsudo make install\n```\n\n`runc` will be installed to `\u002Fusr\u002Flocal\u002Fsbin\u002Frunc` on your system.\n\n#### Version string customization\n\nYou can see the runc version by running `runc --version`. You can append a custom string to the\nversion using the `EXTRA_VERSION` make variable when building, e.g.:\n\n```bash\nmake EXTRA_VERSION=\"+build-1\"\n```\n\nBear in mind to include some separator for readability.\n\n#### Build Tags\n\n`runc` supports optional build tags for compiling support of various features,\nwith some of them enabled by default in the top-level Makefile.\n\nThe following build tags are currently recognized:\n\n| Build Tag     | Feature                               | Set by Default | Dependencies        |\n|---------------|---------------------------------------|----------------|---------------------|\n| `seccomp`     | Syscall filtering using `libseccomp`. | yes            | `libseccomp`        |\n| `libpathrs`   | Use [`libpathrs`][] for path safety.  | yes            | [`libpathrs`][]     |\n| `runc_nocriu` | **Disables** runc checkpoint\u002Frestore. | no             | `criu`              |\n\n[`libpathrs`]: https:\u002F\u002Fgithub.com\u002Fcyphar\u002Flibpathrs\n\nTo add or remove build tags from the default set, use the `RUNC_BUILDTAGS`\nmake or shell variable. Tags prefixed with `-` are removed from the default set;\nothers are added. For example:\n\n```bash\n# Add runc_nocriu and remove seccomp tag.\nmake RUNC_BUILDTAGS=\"runc_nocriu -seccomp\"\n```\n\nThe following build tags were used earlier, but are now obsoleted:\n - **runc_nodmz** (since runc v1.2.1 runc dmz binary is dropped)\n - **nokmem** (since runc v1.0.0-rc94 kernel memory settings are ignored)\n - **apparmor** (since runc v1.0.0-rc93 the feature is always enabled)\n - **selinux**  (since runc v1.0.0-rc93 the feature is always enabled)\n\n### Running the test suite\n\n`runc` currently supports running its test suite via Docker.\nTo run the suite just type `make test`.\n\n```bash\nmake test\n```\n\nThere are additional make targets for running the tests outside of a container but this is not recommended as the tests are written with the expectation that they can write and remove anywhere.\n\nYou can run a specific test case by setting the `TESTFLAGS` variable.\n\n```bash\n# make test TESTFLAGS=\"-run=SomeTestFunction\"\n```\n\nYou can run a specific integration test by setting the `TESTPATH` variable.\n\n```bash\n# make test TESTPATH=\"\u002Fcheckpoint.bats\"\n```\n\nYou can run a specific rootless integration test by setting the `ROOTLESS_TESTPATH` variable.\n\n```bash\n# make test ROOTLESS_TESTPATH=\"\u002Fcheckpoint.bats\"\n```\n\nYou can run a test using your container engine's flags by setting `CONTAINER_ENGINE_BUILD_FLAGS` and `CONTAINER_ENGINE_RUN_FLAGS` variables.\n\n```bash\n# make test CONTAINER_ENGINE_BUILD_FLAGS=\"--build-arg http_proxy=http:\u002F\u002Fyourproxy\u002F\" CONTAINER_ENGINE_RUN_FLAGS=\"-e http_proxy=http:\u002F\u002Fyourproxy\u002F\"\n```\n\n### Go Dependencies Management\n\n`runc` uses [Go Modules](https:\u002F\u002Fgithub.com\u002Fgolang\u002Fgo\u002Fwiki\u002FModules) for dependencies management.\nPlease refer to [Go Modules](https:\u002F\u002Fgithub.com\u002Fgolang\u002Fgo\u002Fwiki\u002FModules) for how to add or update\nnew dependencies.\n\n```\n# Update vendored dependencies\nmake vendor\n# Verify all dependencies\nmake verify-dependencies\n```\n\n## Using runc\n\nPlease note that runc is a low level tool not designed with an end user\nin mind. It is mostly employed by other higher level container software.\n\nTherefore, unless there is some specific use case that prevents the use\nof tools like Docker or Podman, it is not recommended to use runc directly.\n\nIf you still want to use runc, here's how.\n\n### Creating an OCI Bundle\n\nIn order to use runc you must have your container in the format of an OCI bundle.\nIf you have Docker installed you can use its `export` method to acquire a root filesystem from an existing Docker container.\n\n```bash\n# create the top most bundle directory\nmkdir \u002Fmycontainer\ncd \u002Fmycontainer\n\n# create the rootfs directory\nmkdir rootfs\n\n# export busybox via Docker into the rootfs directory\ndocker export $(docker create busybox) | tar -C rootfs -xvf -\n```\n\nAfter a root filesystem is populated you just generate a spec in the format of a `config.json` file inside your bundle.\n`runc` provides a `spec` command to generate a base template spec that you are then able to edit.\nTo find features and documentation for fields in the spec please refer to the [specs](https:\u002F\u002Fgithub.com\u002Fopencontainers\u002Fruntime-spec) repository.\n\n```bash\nrunc spec\n```\n\n### Running Containers\n\nAssuming you have an OCI bundle from the previous step you can execute the container in two different ways.\n\nThe first way is to use the convenience command `run` that will handle creating, starting, and deleting the container after it exits.\n\n```bash\n# run as root\ncd \u002Fmycontainer\nrunc run mycontainerid\n```\n\nIf you used the unmodified `runc spec` template this should give you a `sh` session inside the container.\n\nThe second way to start a container is using the specs lifecycle operations.\nThis gives you more power over how the container is created and managed while it is running.\nThis will also launch the container in the background so you will have to edit\nthe `config.json` to remove the `terminal` setting for the simple examples\nbelow (see more details about [runc terminal handling](docs\u002Fterminals.md)).\nYour process field in the `config.json` should look like this below with `\"terminal\": false` and `\"args\": [\"sleep\", \"5\"]`.\n\n\n```json\n        \"process\": {\n                \"terminal\": false,\n                \"user\": {\n                        \"uid\": 0,\n                        \"gid\": 0\n                },\n                \"args\": [\n                        \"sleep\", \"5\"\n                ],\n                \"env\": [\n                        \"PATH=\u002Fusr\u002Flocal\u002Fsbin:\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fsbin:\u002Fusr\u002Fbin:\u002Fsbin:\u002Fbin\",\n                        \"TERM=xterm\"\n                ],\n                \"cwd\": \"\u002F\",\n                \"capabilities\": {\n                        \"bounding\": [\n                                \"CAP_AUDIT_WRITE\",\n                                \"CAP_KILL\",\n                                \"CAP_NET_BIND_SERVICE\"\n                        ],\n                        \"effective\": [\n                                \"CAP_AUDIT_WRITE\",\n                                \"CAP_KILL\",\n                                \"CAP_NET_BIND_SERVICE\"\n                        ],\n                        \"inheritable\": [\n                                \"CAP_AUDIT_WRITE\",\n                                \"CAP_KILL\",\n                                \"CAP_NET_BIND_SERVICE\"\n                        ],\n                        \"permitted\": [\n                                \"CAP_AUDIT_WRITE\",\n                                \"CAP_KILL\",\n                                \"CAP_NET_BIND_SERVICE\"\n                        ],\n                        \"ambient\": [\n                                \"CAP_AUDIT_WRITE\",\n                                \"CAP_KILL\",\n                                \"CAP_NET_BIND_SERVICE\"\n                        ]\n                },\n                \"rlimits\": [\n                        {\n                                \"type\": \"RLIMIT_NOFILE\",\n                                \"hard\": 1024,\n                                \"soft\": 1024\n                        }\n                ],\n                \"noNewPrivileges\": true\n        },\n```\n\nNow we can go through the lifecycle operations in your shell.\n\n\n```bash\n# run as root\ncd \u002Fmycontainer\nrunc create mycontainerid\n\n# view the container is created and in the \"created\" state\nrunc list\n\n# start the process inside the container\nrunc start mycontainerid\n\n# after 5 seconds view that the container has exited and is now in the stopped state\nrunc list\n\n# now delete the container\nrunc delete mycontainerid\n```\n\nThis allows higher level systems to augment the containers creation logic with setup of various settings after the container is created and\u002For before it is deleted. For example, the container's network stack is commonly set up after `create` but before `start`.\n\n#### Rootless containers\n`runc` has the ability to run containers without root privileges. This is called `rootless`. You need to pass some parameters to `runc` in order to run rootless containers. See below and compare with the previous version.\n\n**Note:** In order to use this feature, \"User Namespaces\" must be compiled and enabled in your kernel. There are various ways to do this depending on your distribution:\n- Confirm `CONFIG_USER_NS=y` is set in your kernel configuration (normally found in `\u002Fproc\u002Fconfig.gz`)\n- Arch\u002FDebian: `echo 1 > \u002Fproc\u002Fsys\u002Fkernel\u002Funprivileged_userns_clone`\n- RHEL\u002FCentOS 7: `echo 28633 > \u002Fproc\u002Fsys\u002Fuser\u002Fmax_user_namespaces`\n\nRun the following commands as an ordinary user:\n```bash\n# Same as the first example\nmkdir ~\u002Fmycontainer\ncd ~\u002Fmycontainer\nmkdir rootfs\ndocker export $(docker create busybox) | tar -C rootfs -xvf -\n\n# The --rootless parameter instructs runc spec to generate a configuration for a rootless container, which will allow you to run the container as a non-root user.\nrunc spec --rootless\n\n# The --root parameter tells runc where to store the container state. It must be writable by the user.\nrunc --root \u002Ftmp\u002Frunc run mycontainerid\n```\n\n#### Supervisors\n\n`runc` can be used with process supervisors and init systems to ensure that containers are restarted when they exit.\nAn example systemd unit file looks something like this.\n\n```systemd\n[Unit]\nDescription=Start My Container\n\n[Service]\nType=forking\nExecStart=\u002Fusr\u002Flocal\u002Fsbin\u002Frunc run -d --pid-file \u002Frun\u002Fmycontainerid.pid mycontainerid\nExecStopPost=\u002Fusr\u002Flocal\u002Fsbin\u002Frunc delete mycontainerid\nWorkingDirectory=\u002Fmycontainer\nPIDFile=\u002Frun\u002Fmycontainerid.pid\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## More documentation\n\n* [Spec conformance](.\u002Fdocs\u002Fspec-conformance.md)\n* [cgroup v2](.\u002Fdocs\u002Fcgroup-v2.md)\n* [Checkpoint and restore](.\u002Fdocs\u002Fcheckpoint-restore.md)\n* [systemd cgroup driver](.\u002Fdocs\u002Fsystemd.md)\n* [Terminals and standard IO](.\u002Fdocs\u002Fterminals.md)\n* [Experimental features](.\u002Fdocs\u002Fexperimental.md)\n* [Deprecated features](.\u002Fdocs\u002Fdeprecated.md)\n\n## License\n\nThe code and docs are released under the [Apache 2.0 license](LICENSE).\n","runc 是一个根据开放容器倡议（OCI）规范在Linux上启动和运行容器的命令行工具。它采用Go语言编写，支持通过CLI对容器进行管理，并且严格遵循OCI标准来确保容器的兼容性和安全性。该项目具备强大的安全特性，包括支持seccomp以增强容器隔离性，并可选集成Rust库libpathrs提升路径安全性。适用于需要直接控制容器运行时环境的场景，如构建自定义容器平台或优化现有Docker等容器化应用的基础架构。",2,"2026-06-11 03:01:43","top_language"]