{"id":18773903,"url":"https://github.com/ejunjsh/runc-example","last_synced_at":"2026-02-12T14:03:17.442Z","repository":{"id":109691051,"uuid":"154164659","full_name":"ejunjsh/runc-example","owner":"ejunjsh","description":"an experiment for runc","archived":false,"fork":false,"pushed_at":"2018-11-22T14:26:32.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-29T08:41:56.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ejunjsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T15:07:37.000Z","updated_at":"2018-11-22T14:26:33.000Z","dependencies_parsed_at":"2023-03-12T07:01:36.884Z","dependency_job_id":null,"html_url":"https://github.com/ejunjsh/runc-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejunjsh%2Frunc-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejunjsh%2Frunc-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejunjsh%2Frunc-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejunjsh%2Frunc-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejunjsh","download_url":"https://codeload.github.com/ejunjsh/runc-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239680985,"owners_count":19679509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T19:36:14.939Z","updated_at":"2026-02-12T14:03:12.410Z","avatar_url":"https://github.com/ejunjsh.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# runc-example\n\n## install runc\n\n````\ngo get github.com/opencontainers/runc\ncd $GOPATH/src/github.com/opencontainers/runc\nmake\nsudo make install\n````\n\n## make busybox file system\n\n````\n# create the top most bundle directory\nmkdir /mycontainer\ncd /mycontainer\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````\n\n## make spec\n\n````\n# generate config.json\nrunc spec\n````\n\nbelow is the `config.json`\n````json\n{\n\t\"ociVersion\": \"1.0.1-dev\",\n\t\"process\": {\n\t\t\"terminal\": true,\n\t\t\"user\": {\n\t\t\t\"uid\": 0,\n\t\t\t\"gid\": 0\n\t\t},\n\t\t\"args\": [\n\t\t\t\"sh\"\n\t\t],\n\t\t\"env\": [\n\t\t\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n\t\t\t\"TERM=xterm\"\n\t\t],\n\t\t\"cwd\": \"/\",\n\t\t\"capabilities\": {\n\t\t\t\"bounding\": [\n\t\t\t\t\"CAP_AUDIT_WRITE\",\n\t\t\t\t\"CAP_KILL\",\n\t\t\t\t\"CAP_NET_BIND_SERVICE\"\n\t\t\t],\n\t\t\t\"effective\": [\n\t\t\t\t\"CAP_AUDIT_WRITE\",\n\t\t\t\t\"CAP_KILL\",\n\t\t\t\t\"CAP_NET_BIND_SERVICE\"\n\t\t\t],\n\t\t\t\"inheritable\": [\n\t\t\t\t\"CAP_AUDIT_WRITE\",\n\t\t\t\t\"CAP_KILL\",\n\t\t\t\t\"CAP_NET_BIND_SERVICE\"\n\t\t\t],\n\t\t\t\"permitted\": [\n\t\t\t\t\"CAP_AUDIT_WRITE\",\n\t\t\t\t\"CAP_KILL\",\n\t\t\t\t\"CAP_NET_BIND_SERVICE\"\n\t\t\t],\n\t\t\t\"ambient\": [\n\t\t\t\t\"CAP_AUDIT_WRITE\",\n\t\t\t\t\"CAP_KILL\",\n\t\t\t\t\"CAP_NET_BIND_SERVICE\"\n\t\t\t]\n\t\t},\n\t\t\"rlimits\": [\n\t\t\t{\n\t\t\t\t\"type\": \"RLIMIT_NOFILE\",\n\t\t\t\t\"hard\": 1024,\n\t\t\t\t\"soft\": 1024\n\t\t\t}\n\t\t],\n\t\t\"noNewPrivileges\": true\n\t},\n\t\"root\": {\n\t\t\"path\": \"rootfs\",\n\t\t\"readonly\": true\n\t},\n\t\"hostname\": \"runc\",\n\t\"mounts\": [\n\t\t{\n\t\t\t\"destination\": \"/proc\",\n\t\t\t\"type\": \"proc\",\n\t\t\t\"source\": \"proc\"\n\t\t},\n\t\t{\n\t\t\t\"destination\": \"/dev\",\n\t\t\t\"type\": \"tmpfs\",\n\t\t\t\"source\": \"tmpfs\",\n\t\t\t\"options\": [\n\t\t\t\t\"nosuid\",\n\t\t\t\t\"strictatime\",\n\t\t\t\t\"mode=755\",\n\t\t\t\t\"size=65536k\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"destination\": \"/dev/pts\",\n\t\t\t\"type\": \"devpts\",\n\t\t\t\"source\": \"devpts\",\n\t\t\t\"options\": [\n\t\t\t\t\"nosuid\",\n\t\t\t\t\"noexec\",\n\t\t\t\t\"newinstance\",\n\t\t\t\t\"ptmxmode=0666\",\n\t\t\t\t\"mode=0620\",\n\t\t\t\t\"gid=5\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"destination\": \"/dev/shm\",\n\t\t\t\"type\": \"tmpfs\",\n\t\t\t\"source\": \"shm\",\n\t\t\t\"options\": [\n\t\t\t\t\"nosuid\",\n\t\t\t\t\"noexec\",\n\t\t\t\t\"nodev\",\n\t\t\t\t\"mode=1777\",\n\t\t\t\t\"size=65536k\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"destination\": \"/dev/mqueue\",\n\t\t\t\"type\": \"mqueue\",\n\t\t\t\"source\": \"mqueue\",\n\t\t\t\"options\": [\n\t\t\t\t\"nosuid\",\n\t\t\t\t\"noexec\",\n\t\t\t\t\"nodev\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"destination\": \"/sys\",\n\t\t\t\"type\": \"sysfs\",\n\t\t\t\"source\": \"sysfs\",\n\t\t\t\"options\": [\n\t\t\t\t\"nosuid\",\n\t\t\t\t\"noexec\",\n\t\t\t\t\"nodev\",\n\t\t\t\t\"ro\"\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"destination\": \"/sys/fs/cgroup\",\n\t\t\t\"type\": \"cgroup\",\n\t\t\t\"source\": \"cgroup\",\n\t\t\t\"options\": [\n\t\t\t\t\"nosuid\",\n\t\t\t\t\"noexec\",\n\t\t\t\t\"nodev\",\n\t\t\t\t\"relatime\",\n\t\t\t\t\"ro\"\n\t\t\t]\n\t\t}\n\t],\n\t\"linux\": {\n\t\t\"resources\": {\n\t\t\t\"devices\": [\n\t\t\t\t{\n\t\t\t\t\t\"allow\": false,\n\t\t\t\t\t\"access\": \"rwm\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"namespaces\": [\n\t\t\t{\n\t\t\t\t\"type\": \"pid\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"network\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"ipc\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"uts\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"mount\"\n\t\t\t}\n\t\t],\n\t\t\"maskedPaths\": [\n\t\t\t\"/proc/kcore\",\n\t\t\t\"/proc/latency_stats\",\n\t\t\t\"/proc/timer_list\",\n\t\t\t\"/proc/timer_stats\",\n\t\t\t\"/proc/sched_debug\",\n\t\t\t\"/sys/firmware\",\n\t\t\t\"/proc/scsi\"\n\t\t],\n\t\t\"readonlyPaths\": [\n\t\t\t\"/proc/asound\",\n\t\t\t\"/proc/bus\",\n\t\t\t\"/proc/fs\",\n\t\t\t\"/proc/irq\",\n\t\t\t\"/proc/sys\",\n\t\t\t\"/proc/sysrq-trigger\"\n\t\t]\n\t}\n}\n````\n\n## start a runc container\n\n````\n# run as root\ncd /mycontainer\nrunc run mycontainer\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejunjsh%2Frunc-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejunjsh%2Frunc-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejunjsh%2Frunc-example/lists"}