{"id":13590734,"url":"https://github.com/rancher/k3c","last_synced_at":"2025-04-08T14:31:35.674Z","repository":{"id":54846161,"uuid":"231683521","full_name":"rancher/k3c","owner":"rancher","description":"Lightweight local container engine for container development","archived":true,"fork":false,"pushed_at":"2021-01-25T20:26:32.000Z","size":7874,"stargazers_count":566,"open_issues_count":12,"forks_count":23,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-03-21T23:35:39.972Z","etag":null,"topics":["docker","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rancher.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}},"created_at":"2020-01-03T23:49:06.000Z","updated_at":"2025-02-28T16:21:25.000Z","dependencies_parsed_at":"2022-08-14T04:40:20.518Z","dependency_job_id":null,"html_url":"https://github.com/rancher/k3c","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancher%2Fk3c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancher%2Fk3c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancher%2Fk3c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancher%2Fk3c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rancher","download_url":"https://codeload.github.com/rancher/k3c/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247860662,"owners_count":21008329,"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":["docker","kubernetes"],"created_at":"2024-08-01T16:00:49.982Z","updated_at":"2025-04-08T14:31:35.384Z","avatar_url":"https://github.com/rancher.png","language":"Go","funding_links":[],"categories":["docker","Go"],"sub_categories":[],"readme":"k3c - Classic Docker (Build) for a Kubernetes world\n===========================================\n\n***STATUS: EXPERIMENT - Let us know what you think***\n\n***NOTE: the original experiment started on `master` while the next-gen work will be on `main`***\n\n`k3c` brings the Classic \u0026trade; Docker images manipulation UX to your\n`k3s` development workflow. It is designed to enable the rapid feedback\nwhen developing and testing local container images in `k3s` and `rke2`.\nCurrently `k3s`, the [lightweight Kubernetes distribution](https://github.com/k3s-io/k3s),\nprovides a great solution for Kubernetes from dev to production.  While\n`k3s` satisifies the Kubernetes runtime needs, one still needs to run\n`docker` (or a docker-like tool) to actually develop and build the container\nimages.  `k3c` is intended to replace `docker` for just the functionality\nneeded for building and manipulating images in the Kubernetes ecosystem.\n\n## A familiar UX\n\nThere really is nothing better than the classic Docker UX of `build/push/pull/tag`.\nThis tool copies the same UX as classic Docker (think Docker v1.12). The intention\nis to follow the same style but not be a 100% drop in replacement.  Behaviour and\narguments have been changed to better match the behavior of the Kubernetes ecosystem.\n\n## A single binary\n\n`k3c`, similar to `k3s` and old school docker, is packaged as a single binary, because nothing\nis easier for distribution than a static binary.\n\n## Built on Kubernetes Tech (and others)\n\nFundamentally `k3c` is a built on the [Container Runtime Interface (CRI)](https://github.com/kubernetes/cri-api),\n[containerd](https://github.com/containerd/containerd), and [buildkit](https://github.com/moby/buildkit).\n\n## Architecture\n\n`k3c` enables building `k3s`-local images by installing a DaemonSet Pod that runs both `buildkitd` and `k3c agent`\nand exposing the gRPC endpoints for these active agents in your cluster via a Service. Once installed, the `k3c` CLI\ncan inspect your installation and communicate with the backend daemons for image building and manipulation with merely\nthe KUBECONFIG that was available when invoking `k3c install`. When building `k3c` will talk directly to the `buildkit`\nservice but all other interactions with the underlying containerd/CRI are mediated by the `k3c agent` (primarily\nbecause the `containerd` client code assumes a certain level of co-locality with the `containerd` installation).\n\n## Building\n\n```bash\n# more to come on this front but builds are currently a very manual affair\n# git clone --branch=trunk https://github.com/rancher/k3c.git ~/Projects/rancher/k3c\n# cd ~/Projects/rancher/k3c\ngo generate # only necessary when modifying the gRPC protobuf IDL, see Dockerfile for pre-reqs\nmake ORG=\u003cyour-dockerhub-org\u003e build publish\n```\n\n## Running\n\nHave a working `k3s` installation with a working `$HOME/.kube/config` or `$KUBECONFIG`, then:\n\n```bash\n# Installation on a single-node cluster\n./bin/k3c install --agent-image=docker.io/${ORG}/k3c\n```\n\n```bash\n# Installation on a multi-node cluster, targeting a Node named \"my-builder-node\"\n./bin/k3c install --agent-image=docker.io/${ORG}/k3c --selector k3s.io/hostname=my-builder-node\n\n```\n\n`k3c` currently works against a single builder node so you must specify a narrow selector when\ninstalling on multi-node clusters. Upon successful installation this node will acquire the \"builder\" role.\n\nBuild images like you would with `docker`\n\n```\n$ ./bin/k3c --help\nUsage:\n  k3c [flags]\n  k3c [command]\n\nAvailable Commands:\n  build       Build an image\n  help        Help about any command\n  images      List images\n  install     Install builder component(s)\n  pull        Pull an image\n  push        Push an image\n  rmi         Remove an image\n  tag         Tag an image\n  uninstall   Uninstall builder component(s)\n\nFlags:\n  -x, --context string      kubeconfig context for authentication\n      --debug               \n      --debug-level int     \n  -h, --help                help for k3c\n  -k, --kubeconfig string   kubeconfig for authentication\n  -n, --namespace string    namespace (default \"k3c\")\n  -v, --version             version for k3c\n\nUse \"k3c [command] --help\" for more information about a command.\n```\n\n## Roadmap\n\n- Automated builds for clients on MacOS (amd64/arm64), Windows (amd64), and Linux client/server (amd64/arm64/arm).\n\n# License\n\nCopyright (c) 2020-2021 [Rancher Labs, Inc.](http://rancher.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Francher%2Fk3c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Francher%2Fk3c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Francher%2Fk3c/lists"}