{"id":13876054,"url":"https://github.com/kvaps/kubectl-build","last_synced_at":"2025-07-07T02:05:23.238Z","repository":{"id":46707164,"uuid":"291094151","full_name":"kvaps/kubectl-build","owner":"kvaps","description":"Build dockerfiles directly in your Kubernetes cluster.","archived":false,"fork":false,"pushed_at":"2021-11-18T23:01:51.000Z","size":58,"stargazers_count":147,"open_issues_count":3,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T05:54:30.169Z","etag":null,"topics":["docker","kaniko","kubectl","kubectl-plugin","kubectl-plugins","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/kvaps.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-08-28T16:26:58.000Z","updated_at":"2025-03-24T15:44:54.000Z","dependencies_parsed_at":"2022-08-30T07:10:22.868Z","dependency_job_id":null,"html_url":"https://github.com/kvaps/kubectl-build","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/kvaps/kubectl-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkubectl-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkubectl-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkubectl-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkubectl-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvaps","download_url":"https://codeload.github.com/kvaps/kubectl-build/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkubectl-build/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264000629,"owners_count":23542112,"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","kaniko","kubectl","kubectl-plugin","kubectl-plugins","kubernetes"],"created_at":"2024-08-06T06:00:59.093Z","updated_at":"2025-07-07T02:05:23.182Z","avatar_url":"https://github.com/kvaps.png","language":"Shell","funding_links":[],"categories":["Shell","kubernetes"],"sub_categories":[],"readme":"# Kubectl build\n\nKubectl build mimics the kaniko executor, but performs building on your Kubernetes cluster side.  \nThis allows you to simply build your local dockerfiles remotely without leaving your cozy environment.\n\n![demo](https://gist.githubusercontent.com/kvaps/7d823b727a87d244d1f25deb5ff592da/raw/13062e62deb269f9385bc1c995382a589c34f04b/kubectl-build.gif)\n\n## Installation\n\nusing [krew](https://krew.sigs.k8s.io/):\n\n\u003cpre\u003e\nkubectl krew index add kvaps \u003ca href=\"https://github.com/kvaps/krew-index\"\u003ehttps://github.com/kvaps/krew-index\u003c/a\u003e\nkubectl krew install kvaps/build\n\u003c/pre\u003e\n\nor using curl:\n\n```bash\ncurl -LO https://github.com/kvaps/kubectl-build/raw/master/kubectl-build\nchmod +x ./kubectl-build\nsudo mv ./kubectl-build /usr/local/bin/kubectl-build\n```\n\n## Usage\n\n```bash\nkubectl build [args]\n```\n\n## Examples\n\n```bash\n# Show all kaniko commands\nkubectl build --help\n\n# Build from current directory\nkubectl build --context . --no-push\n\n# Specify namespace and kubeconfig\nkubectl build --context . --no-push --namespace default --kubeconfig ~/.kube/someconfig\n\n# Login to remote registry\ndocker login docker.io\n\n# Short form\nkubectl build -c . -d docker.io/some/image:latest\n\n# Run debug shell\nkubectl build -c . --no-push --debug\n\n# Use cache building\nkubectl build --context . --destination docker.io/some/image:latest --cache --cache-repo docker.io/some/cache\n\n# Save image name and digest to file\nkubectl build --context . --destination docker.io/some/image:latest --digest-file /tmp/digest --image-name-with-digest-file /tmp/image\n\n# Build from stdin\ntar -cvf- . | kubectl build --destination docker.io/some/image:latest --context tar://stdin\n```\n\n## Extra configuration\n\nWhile standard behavior of kubectl-build plugin intend to repeat kaniko executor options. The additional configuration can be specified by setting environment variables.\n\nThis may be useful for both having permanent configuration and setting CI-systems.\n\n| Enivroment Variable                | Description                                                                    | Default value                    |\n|------------------------------------|--------------------------------------------------------------------------------|----------------------------------|\n| `KUBECTL_BUILD_CONTEXT`            | Kubernetes context for creating pod (may be overriden by `--kubecontext`)      | current context                  |\n| `KUBECTL_BUILD_DOCKER_CONFIG`      | Path to dockerconfig file to forward                                           | `~/.docker/config.json`          |\n| `KUBECTL_BUILD_IMAGE`              | Kaniko-executor image                                                          | `gcr.io/kaniko-project/executor` |\n| `KUBECTL_BUILD_KEEP_POD`           | If set to `true` do not delete pod after finising process                      | `false`                          |\n| `KUBECTL_BUILD_KUBECONFIG`         | Path to kubeconfig file for creating pods (may be overriden by `--kubeconfig`) | kubectl defaults                 |\n| `KUBECTL_BUILD_METADATA_OVERRIDES` | Json patch to override metadata for creating pods                              | `{}`                             |\n| `KUBECTL_BUILD_NAME_OVERRIDE`      | Name for creating pod                                                          | `kaniko-rand6n`                  |\n| `KUBECTL_BUILD_NAMESPACE`          | Kubernetes namespace for creating pod (may be overriden by `--namespace`)      | current namespace                |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fkubectl-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvaps%2Fkubectl-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fkubectl-build/lists"}