Skip to content
Snippets Groups Projects
Commit e8b89fde authored by Kiran Patel's avatar Kiran Patel
Browse files

fix: use $HOME for skopeo credentials for rootless use

parent 9ea376f0
No related branches found
No related tags found
No related merge requests found
......@@ -347,9 +347,9 @@ stages:
fi
# Create the configuration file for Skopeo
mkdir -p /skopeo/.docker
echo "${docker_snapshot_config_json}" > /skopeo/.docker/src-config.json
echo "${docker_release_config_json}" > /skopeo/.docker/dest-config.json
mkdir -p "$HOME/skopeo/.docker"
echo "${docker_snapshot_config_json}" > "$HOME/skopeo/.docker/src-config.json"
echo "${docker_release_config_json}" > "$HOME/skopeo/.docker/dest-config.json"
log_info "Docker authentication configured for \\e[33;1m${docker_snapshot_registry_host}\\e[0m"
}
......@@ -788,9 +788,9 @@ docker-publish:
log_warn "\\e[93mYou should consider distinguishing snapshot and release images as they do not differ. Skipping publish phase as image has already been created by previous job.\\e[0m"
exit 0
fi
skopeo copy --src-authfile /skopeo/.docker/src-config.json --dest-authfile /skopeo/.docker/dest-config.json ${DOCKER_PUBLISH_ARGS} docker://$DOCKER_SNAPSHOT_IMAGE docker://$DOCKER_RELEASE_IMAGE
skopeo copy --src-authfile $HOME/skopeo/.docker/src-config.json --dest-authfile $HOME/skopeo/.docker/dest-config.json ${DOCKER_PUBLISH_ARGS} docker://$DOCKER_SNAPSHOT_IMAGE docker://$DOCKER_RELEASE_IMAGE
log_info "Well done your image is published and can be downloaded by doing: docker pull $DOCKER_RELEASE_IMAGE"
- docker_digest=$(skopeo inspect --authfile /skopeo/.docker/dest-config.json --format='{{ .Digest }}' "docker://$DOCKER_RELEASE_IMAGE")
- docker_digest=$(skopeo inspect --authfile $HOME/skopeo/.docker/dest-config.json --format='{{ .Digest }}' "docker://$DOCKER_RELEASE_IMAGE")
- docker_repository=${DOCKER_RELEASE_IMAGE%:*}
- docker_tag=${DOCKER_RELEASE_IMAGE##*:}
- echo "docker_image=$DOCKER_RELEASE_IMAGE" > docker.env
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment