Kaniko 是专为 K8s 环境设计的容器构建工具:
apiVersion: v1
kind: Pod
metadata:
name: kaniko-builder
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:latest
args: ["--dockerfile=Dockerfile", "--context=dir:///workspace", "--destination=yourimage"]
volumeMounts:
- name: workspace
mountPath: /workspace