diff --git a/task/push-dockerfile-oci-ta/0.1/push-dockerfile-oci-ta.yaml b/task/push-dockerfile-oci-ta/0.1/push-dockerfile-oci-ta.yaml index c3e93b8e46..65b4d0d057 100644 --- a/task/push-dockerfile-oci-ta/0.1/push-dockerfile-oci-ta.yaml +++ b/task/push-dockerfile-oci-ta/0.1/push-dockerfile-oci-ta.yaml @@ -104,10 +104,12 @@ spec: dockerfile_image=${IMAGE%:*}:${IMAGE_DIGEST/:/-}${TAG_SUFFIX} - cd "$(dirname $dockerfile_path)" + dockerfile_for_upload_path=/tmp/Dockerfile + cp "$dockerfile_path" "$dockerfile_for_upload_path" + cd "$(dirname $dockerfile_for_upload_path)" retry oras push --no-tty \ --format json \ --registry-config "$auth_json" \ --artifact-type "$ARTIFACT_TYPE" \ - "$dockerfile_image" "$(basename $dockerfile_path)" | + "$dockerfile_image" "$(basename $dockerfile_for_upload_path)" | yq '.reference' | tr -d '\r\n' >"$IMAGE_REF_RESULT" diff --git a/task/push-dockerfile/0.1/push-dockerfile.yaml b/task/push-dockerfile/0.1/push-dockerfile.yaml index 74728f0781..eafc3c0198 100644 --- a/task/push-dockerfile/0.1/push-dockerfile.yaml +++ b/task/push-dockerfile/0.1/push-dockerfile.yaml @@ -85,12 +85,14 @@ spec: dockerfile_image=${IMAGE%:*}:${IMAGE_DIGEST/:/-}${TAG_SUFFIX} - cd "$(dirname $dockerfile_path)" + dockerfile_for_upload_path=/tmp/Dockerfile + cp "$dockerfile_path" "$dockerfile_for_upload_path" + cd "$(dirname $dockerfile_for_upload_path)" retry oras push --no-tty \ --format json \ --registry-config "$auth_json" \ --artifact-type "$ARTIFACT_TYPE" \ - "$dockerfile_image" "$(basename $dockerfile_path)" \ + "$dockerfile_image" "$(basename $dockerfile_for_upload_path)" \ | yq '.reference' | tr -d '\r\n' >"$IMAGE_REF_RESULT" workspaces: