diff --git a/scripts/skopeo-common.sh b/scripts/skopeo-common.sh index 5023e56..16f0027 100644 --- a/scripts/skopeo-common.sh +++ b/scripts/skopeo-common.sh @@ -29,7 +29,7 @@ exported_or_fail \ declare -x REGISTRY_AUTH_FILE="" -docker_config="${HOME}/.docker/config.json" +docker_config="/workspace/home/.docker/config.json" if [[ -f "${docker_config}" ]]; then phase "Setting REGISTRY_AUTH_FILE to '${docker_config}'" REGISTRY_AUTH_FILE=${docker_config} diff --git a/scripts/skopeo-copy.sh b/scripts/skopeo-copy.sh index 30c7d74..55f14c3 100644 --- a/scripts/skopeo-copy.sh +++ b/scripts/skopeo-copy.sh @@ -6,6 +6,9 @@ set -eu -o pipefail source "$(dirname "${BASH_SOURCE[0]}")/common.sh" source "$(dirname "${BASH_SOURCE[0]}")/skopeo-common.sh" +# Ensure the /tekton/home/.docker directory exists +mkdir -p /workspace/home/.docker + phase "Copying '${PARAMS_SOURCE_IMAGE_URL}' into '${PARAMS_DESTINATION_IMAGE_URL}'" set -x diff --git a/templates/task-skopeo-copy.yaml b/templates/task-skopeo-copy.yaml index 51f76d6..869e14c 100644 --- a/templates/task-skopeo-copy.yaml +++ b/templates/task-skopeo-copy.yaml @@ -61,7 +61,7 @@ spec: volumes: - name: scripts-dir emptyDir: {} - + stepTemplate: env: {{- $variables := list @@ -79,6 +79,9 @@ spec: steps: - name: skopeo-copy + env: + - name: HOME + value: /workspace/home image: {{ .Values.images.skopeo }} script: | {{- include "load_scripts" ( list . ( list "skopeo-" ) ( list "/scripts/skopeo-copy.sh" "/scripts/skopeo-results.sh" ) ) | nindent 8 }}