fix: use Kaniko for Docker builds instead of docker-buildx
The docker-buildx plugin requires privileged mode which isn't enabled by default. Kaniko builds containers without requiring privileged mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+32
-50
@@ -1,6 +1,6 @@
|
|||||||
variables:
|
variables:
|
||||||
- &dotnet_image "mcr.microsoft.com/dotnet/sdk:10.0-preview"
|
- &dotnet_image "mcr.microsoft.com/dotnet/sdk:10.0-preview"
|
||||||
- &docker_image "woodpeckerci/plugin-docker-buildx"
|
- &kaniko_image "gcr.io/kaniko-project/executor:debug"
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# PULL REQUESTS - Build and test only
|
# PULL REQUESTS - Build and test only
|
||||||
@@ -9,31 +9,22 @@ when:
|
|||||||
- event: pull_request
|
- event: pull_request
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
pr-restore:
|
- name: restore
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
|
|
||||||
pr-build:
|
- name: build
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- dotnet build --no-restore -c Release
|
- dotnet build --no-restore -c Release
|
||||||
depends_on: [pr-restore]
|
depends_on: [restore]
|
||||||
|
|
||||||
pr-test:
|
- name: test
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
|
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
|
||||||
depends_on: [pr-build]
|
depends_on: [build]
|
||||||
|
|
||||||
pr-docker-verify:
|
|
||||||
image: *docker_image
|
|
||||||
settings:
|
|
||||||
repo: ghcr.io/barryw/paperlessmcp
|
|
||||||
dockerfile: PaperlessMCP/Dockerfile
|
|
||||||
context: PaperlessMCP
|
|
||||||
dry_run: true
|
|
||||||
depends_on: [pr-test]
|
|
||||||
|
|
||||||
---
|
---
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -44,25 +35,25 @@ when:
|
|||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
restore:
|
- name: restore
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
|
|
||||||
build:
|
- name: build
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- dotnet build --no-restore -c Release
|
- dotnet build --no-restore -c Release
|
||||||
depends_on: [restore]
|
depends_on: [restore]
|
||||||
|
|
||||||
test:
|
- name: test
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
|
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
|
||||||
depends_on: [build]
|
depends_on: [build]
|
||||||
|
|
||||||
# Determine next version based on conventional commits
|
# Determine next version based on conventional commits
|
||||||
version:
|
- name: version
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache bash
|
- apk add --no-cache bash
|
||||||
@@ -119,7 +110,7 @@ steps:
|
|||||||
depends_on: [test]
|
depends_on: [test]
|
||||||
|
|
||||||
# Package NuGet
|
# Package NuGet
|
||||||
package:
|
- name: package
|
||||||
image: *dotnet_image
|
image: *dotnet_image
|
||||||
commands:
|
commands:
|
||||||
- VERSION=$(cat .version)
|
- VERSION=$(cat .version)
|
||||||
@@ -128,55 +119,46 @@ steps:
|
|||||||
- ls -la ./artifacts/
|
- ls -la ./artifacts/
|
||||||
depends_on: [version]
|
depends_on: [version]
|
||||||
|
|
||||||
# Prepare Docker tags
|
# Build and push Docker with Kaniko
|
||||||
docker-tags:
|
- name: docker
|
||||||
image: alpine
|
image: *kaniko_image
|
||||||
|
environment:
|
||||||
|
GHCR_USERNAME:
|
||||||
|
from_secret: github_username
|
||||||
|
GHCR_TOKEN:
|
||||||
|
from_secret: github_token
|
||||||
commands:
|
commands:
|
||||||
- VERSION=$(cat .version)
|
- VERSION=$(cat .version)
|
||||||
- echo "latest" > .docker-tags
|
- mkdir -p /kaniko/.docker
|
||||||
- echo "v${VERSION}" >> .docker-tags
|
- echo "{\"auths\":{\"ghcr.io\":{\"username\":\"$GHCR_USERNAME\",\"password\":\"$GHCR_TOKEN\"}}}" > /kaniko/.docker/config.json
|
||||||
- cat .docker-tags
|
- /kaniko/executor
|
||||||
|
--context=$CI_WORKSPACE/PaperlessMCP
|
||||||
|
--dockerfile=$CI_WORKSPACE/PaperlessMCP/Dockerfile
|
||||||
|
--destination=ghcr.io/barryw/paperlessmcp:v${VERSION}
|
||||||
|
--destination=ghcr.io/barryw/paperlessmcp:latest
|
||||||
|
--build-arg=VERSION=${VERSION}
|
||||||
depends_on: [version]
|
depends_on: [version]
|
||||||
|
|
||||||
# Build and push Docker
|
|
||||||
docker:
|
|
||||||
image: *docker_image
|
|
||||||
settings:
|
|
||||||
repo: ghcr.io/barryw/paperlessmcp
|
|
||||||
dockerfile: PaperlessMCP/Dockerfile
|
|
||||||
context: PaperlessMCP
|
|
||||||
platforms:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
tags_file: .docker-tags
|
|
||||||
registry: ghcr.io
|
|
||||||
username:
|
|
||||||
from_secret: github_username
|
|
||||||
password:
|
|
||||||
from_secret: github_token
|
|
||||||
depends_on: [docker-tags]
|
|
||||||
|
|
||||||
# Create git tag and push
|
# Create git tag and push
|
||||||
git-tag:
|
- name: git-tag
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
secrets: [github_token]
|
environment:
|
||||||
|
GITHUB_TOKEN:
|
||||||
|
from_secret: github_token
|
||||||
commands:
|
commands:
|
||||||
- TAG=$(cat .tag)
|
- TAG=$(cat .tag)
|
||||||
- VERSION=$(cat .version)
|
- VERSION=$(cat .version)
|
||||||
- echo "Creating tag $TAG"
|
- echo "Creating tag $TAG"
|
||||||
- |
|
- |
|
||||||
# Configure git for pushing
|
|
||||||
git config user.email "ci@woodpecker.local"
|
git config user.email "ci@woodpecker.local"
|
||||||
git config user.name "Woodpecker CI"
|
git config user.name "Woodpecker CI"
|
||||||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/barryw/PaperlessMCP.git
|
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/barryw/PaperlessMCP.git
|
||||||
|
|
||||||
# Create and push tag
|
|
||||||
git tag -a "$TAG" -m "Release $VERSION"
|
git tag -a "$TAG" -m "Release $VERSION"
|
||||||
git push origin "$TAG"
|
git push origin "$TAG"
|
||||||
depends_on: [package, docker]
|
depends_on: [package, docker]
|
||||||
|
|
||||||
# Create GitHub release
|
# Create GitHub release
|
||||||
release:
|
- name: release
|
||||||
image: woodpeckerci/plugin-github-release
|
image: woodpeckerci/plugin-github-release
|
||||||
settings:
|
settings:
|
||||||
api_key:
|
api_key:
|
||||||
|
|||||||
Reference in New Issue
Block a user