https://github.com/yinheli/kaniko-build
kaniko cli 工具,可以帮你快速把一个 Dockerfile 在 k8s 集群中打包生成镜像并推送到镜像库
https://github.com/yinheli/kaniko-build
cli k8s kaniko
Last synced: 2 months ago
JSON representation
kaniko cli 工具,可以帮你快速把一个 Dockerfile 在 k8s 集群中打包生成镜像并推送到镜像库
- Host: GitHub
- URL: https://github.com/yinheli/kaniko-build
- Owner: yinheli
- License: mit
- Created: 2023-01-18T09:14:06.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-04T02:19:27.000Z (almost 2 years ago)
- Last Synced: 2025-02-02T05:24:30.818Z (4 months ago)
- Topics: cli, k8s, kaniko
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# kaniko-build
这是一个 kaniko cli 工具,可以帮你快速把一个 `Dockerfile` 在 k8s 集群中打包生成镜像并推送到镜像库。 具体参考 [pod.yaml](./kanikobuild/resource/pod.yaml)
## 安装
```bash
pip install --upgrade git+https://github.com/yinheli/kaniko-build.git
```## 依赖
- python3
- kubectl## 准备工作
### secret
准备 `dockercred` secret 用于推送镜像
```bash
kubectl create secret -n default docker-registry dockercred \
--docker-server=xxx \
--docker-username=xxx \
--docker-password=xxx
```或者用 yaml 声明式创建
> `cat ~/.docker/config.json | base64 -w0`
```yaml
apiVersion: v1
kind: Secret
metadata:
name: dockercred
namespace: default
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: >-
xxx
```## 相关资料
- kaniko https://github.com/GoogleContainerTools/kaniko