feat: Update templates to use Kaniko for rootless builds
Replace Docker-in-Docker (privileged mode) with Kaniko for container builds. This allows CI pipelines to run without requiring trusted repo status in Woodpecker. - astro-landing: Use Kaniko with from_secret for registry auth - go-api: Use Kaniko with from_secret for registry auth - default: Use Kaniko with from_secret for registry auth Kaniko builds and pushes images without requiring privileged mode, making it compatible with Woodpecker's default security settings. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9e3c1c3806
commit
4d2076d144
@ -14,22 +14,23 @@ steps:
|
|||||||
- event: [push, pull_request]
|
- event: [push, pull_request]
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
image: docker:24-dind
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
privileged: true
|
|
||||||
commands:
|
commands:
|
||||||
- docker build -t zot.orchard9.ai/{{PROJECT_NAME}}:latest .
|
- |
|
||||||
- docker build -t zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8} .
|
mkdir -p /kaniko/.docker
|
||||||
when:
|
echo "{\"auths\":{\"zot.orchard9.ai\":{\"username\":\"$ZOT_USER\",\"password\":\"$ZOT_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||||
- event: push
|
- >
|
||||||
|
/kaniko/executor
|
||||||
push:
|
--context .
|
||||||
image: docker:24-dind
|
--dockerfile Dockerfile
|
||||||
privileged: true
|
--destination zot.orchard9.ai/{{PROJECT_NAME}}:latest
|
||||||
commands:
|
--destination zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8}
|
||||||
- echo "$ZOT_PASSWORD" | docker login zot.orchard9.ai -u "$ZOT_USER" --password-stdin
|
--cache=true
|
||||||
- docker push zot.orchard9.ai/{{PROJECT_NAME}}:latest
|
environment:
|
||||||
- docker push zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8}
|
ZOT_USER:
|
||||||
secrets: [zot_user, zot_password]
|
from_secret: zot_user
|
||||||
|
ZOT_PASSWORD:
|
||||||
|
from_secret: zot_password
|
||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
branch: main
|
branch: main
|
||||||
|
|||||||
@ -1,21 +1,22 @@
|
|||||||
steps:
|
steps:
|
||||||
build:
|
docker:
|
||||||
image: docker:24-dind
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
privileged: true
|
|
||||||
commands:
|
commands:
|
||||||
- docker build -t zot.orchard9.ai/{{PROJECT_NAME}}:latest .
|
- |
|
||||||
- docker build -t zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8} .
|
mkdir -p /kaniko/.docker
|
||||||
when:
|
echo "{\"auths\":{\"zot.orchard9.ai\":{\"username\":\"$ZOT_USER\",\"password\":\"$ZOT_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||||
- event: push
|
- >
|
||||||
|
/kaniko/executor
|
||||||
push:
|
--context .
|
||||||
image: docker:24-dind
|
--dockerfile Dockerfile
|
||||||
privileged: true
|
--destination zot.orchard9.ai/{{PROJECT_NAME}}:latest
|
||||||
commands:
|
--destination zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8}
|
||||||
- echo "$ZOT_PASSWORD" | docker login zot.orchard9.ai -u "$ZOT_USER" --password-stdin
|
--cache=true
|
||||||
- docker push zot.orchard9.ai/{{PROJECT_NAME}}:latest
|
environment:
|
||||||
- docker push zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8}
|
ZOT_USER:
|
||||||
secrets: [zot_user, zot_password]
|
from_secret: zot_user
|
||||||
|
ZOT_PASSWORD:
|
||||||
|
from_secret: zot_password
|
||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
branch: main
|
branch: main
|
||||||
|
|||||||
@ -14,22 +14,23 @@ steps:
|
|||||||
- event: [push, pull_request]
|
- event: [push, pull_request]
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
image: docker:24-dind
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
privileged: true
|
|
||||||
commands:
|
commands:
|
||||||
- docker build -t zot.orchard9.ai/{{PROJECT_NAME}}:latest .
|
- |
|
||||||
- docker build -t zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8} .
|
mkdir -p /kaniko/.docker
|
||||||
when:
|
echo "{\"auths\":{\"zot.orchard9.ai\":{\"username\":\"$ZOT_USER\",\"password\":\"$ZOT_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||||
- event: push
|
- >
|
||||||
|
/kaniko/executor
|
||||||
push:
|
--context .
|
||||||
image: docker:24-dind
|
--dockerfile Dockerfile
|
||||||
privileged: true
|
--destination zot.orchard9.ai/{{PROJECT_NAME}}:latest
|
||||||
commands:
|
--destination zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8}
|
||||||
- echo "$ZOT_PASSWORD" | docker login zot.orchard9.ai -u "$ZOT_USER" --password-stdin
|
--cache=true
|
||||||
- docker push zot.orchard9.ai/{{PROJECT_NAME}}:latest
|
environment:
|
||||||
- docker push zot.orchard9.ai/{{PROJECT_NAME}}:${CI_COMMIT_SHA:0:8}
|
ZOT_USER:
|
||||||
secrets: [zot_user, zot_password]
|
from_secret: zot_user
|
||||||
|
ZOT_PASSWORD:
|
||||||
|
from_secret: zot_password
|
||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
branch: main
|
branch: main
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user