From b48019e360f1fac40d5cb4e0900dc626461b7b34 Mon Sep 17 00:00:00 2001 From: BAK BYEONG JUN Date: Sat, 12 Apr 2025 09:22:33 +0000 Subject: [PATCH] init --- tasks/docker-registry/task.yaml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/tasks/docker-registry/task.yaml b/tasks/docker-registry/task.yaml index 60acaec..a0e04a3 100644 --- a/tasks/docker-registry/task.yaml +++ b/tasks/docker-registry/task.yaml @@ -23,7 +23,7 @@ spec: default: ./Dockerfile - name: context - description: Build context path + description: Build context path (relative to subdirectory) type: string default: . @@ -40,13 +40,13 @@ spec: steps: - name: build-and-push - image: alpine:3.18 + image: gcr.io/kaniko-project/executor:v1.23.2 workingDir: /workspace/source env: - name: DOCKER_CONFIG - value: /tekton/home/.docker/ + value: /tekton/home/.docker script: | - #!/bin/sh + #!/busybox/sh set -e if [ -n "$(params.subdirectory)" ]; then @@ -57,14 +57,12 @@ spec: IMAGE="$(params.imageName):$(params.tag)" echo "📦 Using image: $IMAGE" - echo -n "$IMAGE" > /tekton/results/imageUrl - echo "🔐 Loading Docker credentials..." USERNAME=$(cat /workspace/docker-auth/username) PASSWORD=$(cat /workspace/docker-auth/password) REGISTRY=$(echo "$IMAGE" | cut -d/ -f1) - echo "📝 Writing Docker config for $REGISTRY" + echo "🔐 Creating Docker config for $REGISTRY" mkdir -p /tekton/home/.docker cat > /tekton/home/.docker/config.json < /tekton/results/imageUrl