From f5d3146bed42ce0ae539c80ea0c523fca41e0e4a Mon Sep 17 00:00:00 2001 From: khwezi Date: Sun, 8 Mar 2026 12:08:37 +0200 Subject: [PATCH 1/2] Using inline docker config for kaniko --- .drone.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index fd3349a..eb75279 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,15 +29,23 @@ steps: commands: - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - - name: build and push + - name: build-and-push image: gcr.io/kaniko-project/executor:debug environment: - DOCKER_CONFIG: /kaniko/.docker + DOCKER_AUTH_CONFIG: | + { + "auths": { + "https://index.docker.io/v1/": { + "auth": "a2h3ZXppOlBHM0FRM0VPMFg=" + } + } + } commands: - mkdir -p /kaniko/.docker - - echo "$DOCKER_CONFIG_SECRET" > /kaniko/.docker/config.json + - echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json - /kaniko/executor + --verbosity=debug --context=. --dockerfile=Dockerfile - --destination=khwezi/webapitest:latest - --destination=khwezi/webapitest:${DRONE_BUILD_NUMBER} \ No newline at end of file + --destination=index.docker.io/khwezi/webapitest:latest + --destination=index.docker.io/khwezi/webapitest:${DRONE_BUILD_NUMBER} \ No newline at end of file From 7ee42ef0182e4614f5fca31f2450a5501794759c Mon Sep 17 00:00:00 2001 From: khwezi Date: Sun, 8 Mar 2026 12:12:03 +0200 Subject: [PATCH 2/2] Refactored pipeline --- .drone.yml | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/.drone.yml b/.drone.yml index eb75279..df1e8c4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,11 +1,17 @@ ---- +x-docker-auth: &docker-auth + DOCKER_AUTH_CONFIG: | + { + "auths": { + "https://index.docker.io/v1/": { + "auth": "a2h3ZXppOlBHM0FRM0VPMFg=" + } + } + } + kind: pipeline type: docker name: package -clone: - disable: true - steps: - name: clone image: alpine/git @@ -13,33 +19,15 @@ steps: - git clone https://gitea.khongisa.co.za/MngomaLab/webapitest.git . - git checkout ${DRONE_COMMIT} - - name: dotnet publish + - name: dotnet-publish image: mcr.microsoft.com/dotnet/sdk:8.0 commands: - dotnet publish --configuration Release - - ls ./SampleApi/bin/Release/net8.0/publish/ - - - name: docker login - image: docker:20.10 - environment: - DOCKER_USERNAME: - from_secret: docker_username - DOCKER_PASSWORD: - from_secret: docker_password - commands: - - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - name: build-and-push image: gcr.io/kaniko-project/executor:debug environment: - DOCKER_AUTH_CONFIG: | - { - "auths": { - "https://index.docker.io/v1/": { - "auth": "a2h3ZXppOlBHM0FRM0VPMFg=" - } - } - } + <<: *docker-auth commands: - mkdir -p /kaniko/.docker - echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json