{"id":50275478,"url":"https://github.com/ssbagpcm/kiwi","last_synced_at":"2026-05-27T20:02:16.618Z","repository":{"id":352950930,"uuid":"1217233984","full_name":"ssbagpcm/kiwi","owner":"ssbagpcm","description":"An hyper-light container tool written in GO. ","archived":false,"fork":false,"pushed_at":"2026-04-21T19:57:50.000Z","size":15957,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-21T21:41:52.411Z","etag":null,"topics":["alpine","cgroups-v2","container","debian","fast","golang","kiwi","lightweight","linux","namespaces"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssbagpcm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-21T17:20:07.000Z","updated_at":"2026-04-21T19:57:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ssbagpcm/kiwi","commit_stats":null,"previous_names":["ssbagpcm/kiwi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ssbagpcm/kiwi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbagpcm%2Fkiwi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbagpcm%2Fkiwi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbagpcm%2Fkiwi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbagpcm%2Fkiwi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbagpcm","download_url":"https://codeload.github.com/ssbagpcm/kiwi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbagpcm%2Fkiwi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33581559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alpine","cgroups-v2","container","debian","fast","golang","kiwi","lightweight","linux","namespaces"],"created_at":"2026-05-27T20:02:15.023Z","updated_at":"2026-05-27T20:02:16.614Z","avatar_url":"https://github.com/ssbagpcm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kiwi\n\nKiwi is a small Go container runtime built around simple commands, `.kiwi` archives, `overlayfs`, plain directories, Linux namespaces, and `cgroup v2`.\n\nThe goal is to stay easy enough to learn in two minutes.\n\n## Build\n\n```bash\n./build.sh\n```\n\n`build.sh` is interactive and can build `linux-amd64`, `linux-arm64`, `linux-armv7`, or all three. Artifacts are written to `./dist/`, and when the selected target matches the current Linux host, `./kiwi` is updated too.\n\nThis stores Kiwi data next to the binary in the visible `./kiwi-data/` directory. Host-visible mounts only happen when you explicitly run `./kiwi mount \u003cname\u003e \u003ctarget\u003e`.\n\nIf you tested an older Kiwi build, stop any old container first and remove old local data before re-pulling:\n\n```bash\nsudo ./kiwi stop demo 2\u003e/dev/null || true\nrm -rf ./kiwi-data\nsudo ./kiwi pull alpine\n```\n\n## Fast Start\n\n```bash\nsudo ./kiwi pull alpine\nsudo ./kiwi create alpine\nsudo ./kiwi set 8f3b9d2a1c44 --memory 512M --cpu 2 --storage 3G --shell /bin/bash\nsudo ./kiwi attach 8f3b9d2a1c44\nsudo ./kiwi stop 8f3b9d2a1c44\n```\n\n`kiwi create` generates a container id automatically, `kiwi set` changes CPU/RAM/storage/default shell without starting anything, and `kiwi attach` starts the container automatically if needed. `--memory host`, `--cpu host`, and `--storage host` remove the corresponding limits and share the host capacity.\n\n`kiwi attach` accepts a one-shot command, and without a command it chooses a shell automatically (`bash`, `zsh`, `fish`, `ash`, `sh`) or uses the one saved with `kiwi set --shell`.\n\nDefault `attach` opens a reusable Kiwi-managed session on the host, so you can reattach later with `./kiwi attach --old \u003csession\u003e`. If you want a direct shell without the session daemon, use `./kiwi attach --direct \u003cid\u003e`.\n\nKiwi writes a fresh `/etc/resolv.conf` inside the container from the host DNS configuration and falls back to public resolvers when the host only exposes loopback DNS.\n\n```bash\nsudo ./kiwi attach 8f3b9d2a1c44\nsudo ./kiwi attach --direct 8f3b9d2a1c44\nsudo ./kiwi attach --session 8f3b9d2a1c44\nsudo ./kiwi attach --old 5cf2a9d96b2e\nsudo ./kiwi attach 8f3b9d2a1c44 -- uname -a\n./kiwi create ./kiwi-data/8f3b9d2a1c44-base.kiwi\n```\n\nLegacy direct build also works:\n\n```bash\ngo build -o kiwi .\n\nsudo ./kiwi pull alpine\nsudo ./kiwi create alpine\nsudo ./kiwi attach 8f3b9d2a1c44\nsudo ./kiwi stop 8f3b9d2a1c44\n```\n\nBuilt-in test images:\n\n- `kiwi pull alpine` downloads the stock Alpine cloud rootfs and writes `alpine.kiwi`\n- `kiwi pull debian` downloads the stock Debian cloud rootfs and writes `debian.kiwi`\n\n## Commands\n\n```text\n./kiwi list [containers|images|all]\n./kiwi pull \u003calpine|debian\u003e\n./kiwi import --name \u003cimage\u003e /path/rootfs.tar.xz\n./kiwi create \u003cimage|file.kiwi\u003e [--storage 1G]\n./kiwi set \u003cname\u003e [--memory 256M|host] [--cpu 1|host] [--storage 2G|host] [--network host|separate] [--shell /bin/bash]\n./kiwi sessions \u003cname\u003e [--kill \u003csession\u003e] [--delete \u003csession\u003e]\n./kiwi stop \u003cname\u003e\n./kiwi delete \u003cname\u003e [--yes]\nsudo ./kiwi attach \u003cname\u003e [-- command args]\nsudo ./kiwi attach --direct \u003cname\u003e [-- command args]\nsudo ./kiwi attach --session \u003cname\u003e\nsudo ./kiwi attach --old \u003csession\u003e\n./kiwi ip \u003cname\u003e\n./kiwi cleanup\n./kiwi mount \u003cname\u003e \u003ctarget\u003e\n./kiwi unmount \u003cname\u003e\n./kiwi snap \u003cname\u003e \u003csnapshot\u003e\n./kiwi commit \u003ccontainer\u003e \u003cimage\u003e\n./kiwi terminal\n```\n\n## Design\n\n- base image: extracted `rootfs/`, read-only in practice\n- container state: `state/upper` + `state/work`\n- runtime view: `overlayfs`\n- startup: `pivot_root`, minimal `/dev`, `proc`, `sys`, `tmpfs`\n- limits: real `cgroup v2` `memory.max`, `memory.swap.max`, `cpu.max`, `pids.max`\n- cpu visibility: Kiwi also applies a `cpuset`, so interactive shells inherit the container CPU set instead of the full host set\n- network: one private IPv4 per container on `kiwi0`\n- access: use `sudo ./kiwi attach \u003cname\u003e`; it starts the container if needed and opens a sensible shell automatically\n- sessions: plain `attach` opens a reusable Kiwi-managed session; `attach --direct \u003cname\u003e` bypasses it, `attach --old \u003csession\u003e` reattaches to it, and `./kiwi sessions \u003cname\u003e` lists or removes sessions\n- naming: if you omit the name, Kiwi creates a short docker-style hex id automatically\n- archives: `./kiwi create file.kiwi` restores a container directly from a `.kiwi` archive\n- mounts: `./kiwi mount \u003cname\u003e \u003ctarget\u003e` creates the single host-visible mount of the full container filesystem; when the container is already running Kiwi bind-mounts its live rootfs, and plain `attach` does not mount on the host\n\nAt runtime:\n\n```text\nrootfs/ (ro view)   -\u003e lowerdir\nstate/upper (rw)    -\u003e upperdir\nstate/work          -\u003e workdir\noverlayfs           -\u003e merged /\n```\n\n## What `commit` Means\n\n`kiwi commit demo demo-v1` takes the current merged view of the container and turns it into a new reusable base image.\n\nUse it when:\n\n- you installed packages in a container and want to reuse that state\n- you configured a service once and want future containers to start from it\n\nIn short:\n\n- `snap` = write a reusable container archive directly in `./kiwi-data/\u003cid\u003e-\u003cname\u003e.kiwi`\n- `commit` = make a new base image from that container\n\n## Requirements\n\n- Linux\n- root privileges for attach, stop, mount, namespaces, network, and cgroups\n- `mount`\n- `ip`\n- `nsenter`\n\n## Notes\n\n- each container gets its own private IPv4, so port `6000` on the host and port `6000` in a container do not conflict\n- by default Kiwi stores everything near the executable: `./kiwi-data/images`, `./kiwi-data/containers`, `./kiwi-data/mounts`, `./kiwi-data/exports`\n- if an old `./.kiwi` directory exists, Kiwi renames it to the visible `./kiwi-data`\n- if an old `./kiwi-data/run` exists, Kiwi renames it to `./kiwi-data/mounts`\n- `set --memory host`, `set --cpu host`, and `set --storage host` disable the corresponding limits\n- `set --storage` never goes below `1G`, and also refuses anything smaller than current usage plus a 1G safety margin\n- `create file.kiwi` refuses a disk smaller than the archive it is restoring\n- `./kiwi terminal` relaunches itself through `sudo` when needed so the shell keeps the required permissions\n- `sudo ./kiwi cleanup` removes orphaned runtime mounts left behind after a partial manual delete or crash\ntest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbagpcm%2Fkiwi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbagpcm%2Fkiwi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbagpcm%2Fkiwi/lists"}