mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
CI: replace kaniko with buildkit (#12305)
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
This commit is contained in:
@@ -7,23 +7,24 @@ pipeline-image:
|
|||||||
tags:
|
tags:
|
||||||
- ffci
|
- ffci
|
||||||
stage: build
|
stage: build
|
||||||
image:
|
image: moby/buildkit:rootless
|
||||||
name: gcr.io/kaniko-project/executor:debug
|
|
||||||
entrypoint: ['']
|
|
||||||
variables:
|
variables:
|
||||||
GODEBUG: "http2client=0"
|
BUILDKITD_FLAGS: --oci-worker-no-process-sandbox
|
||||||
|
CACHE_IMAGE: $CI_REGISTRY_IMAGE/pipeline:cache
|
||||||
# TODO: remove the override
|
# TODO: remove the override
|
||||||
# currently rebase.sh depends on bash (not available in the kaniko image)
|
# currently rebase.sh depends on bash (not available in the kaniko image)
|
||||||
# once we have a simpler rebase (which should be easy if the target branch ref is available as variable
|
# once we have a simpler rebase (which should be easy if the target branch ref is available as variable
|
||||||
# we'll be able to rebase here as well hopefully
|
# we'll be able to rebase here as well hopefully
|
||||||
before_script: []
|
before_script:
|
||||||
|
- mkdir -p ~/.docker
|
||||||
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > ~/.docker/config.json
|
||||||
script:
|
script:
|
||||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
|
- |
|
||||||
- /kaniko/executor --cache=true
|
buildctl-daemonless.sh build \
|
||||||
--cache-dir=image-cache
|
--frontend dockerfile.v0 \
|
||||||
--context $CI_PROJECT_DIR
|
--local context=$CI_PROJECT_DIR \
|
||||||
--dockerfile $CI_PROJECT_DIR/pipeline.Dockerfile
|
--local dockerfile=$CI_PROJECT_DIR \
|
||||||
--label 'git-branch'=$CI_COMMIT_REF_SLUG
|
--opt filename=pipeline.Dockerfile \
|
||||||
--label 'git-tag=$CI_COMMIT_TAG'
|
--export-cache type=registry,ref=$CACHE_IMAGE \
|
||||||
--destination $PIPELINE_IMAGE
|
--import-cache type=registry,ref=$CACHE_IMAGE \
|
||||||
--log-timestamp=true
|
--output type=image,name=$PIPELINE_IMAGE,push=true
|
||||||
|
|||||||
Reference in New Issue
Block a user