1
0

copy files over to example repo

This commit is contained in:
2022-09-18 18:47:53 -07:00
commit f124c47d34
5 changed files with 115 additions and 0 deletions

17
docker-remote-tag Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Tags an already existing image version in a remote registry without needing to pull/push the whole image
#
# Usage:
# /bin/docker-remote-tag <repo-name> <existing-tag> <new-tag>
#
REPOSITORY="$1"
TAG_OLD="$2"
TAG_NEW="$3"
CONTENT_TYPE="application/vnd.docker.distribution.manifest.v2+json"
MANIFEST=$(curl -H "Accept: ${CONTENT_TYPE}" "${DOCKER_REGISTRY}/v2/${REPOSITORY}/manifests/${TAG_OLD}")
curl -X PUT -H "Content-Type: ${CONTENT_TYPE}" -d "${MANIFEST}" "${DOCKER_REGISTRY}/v2/${REPOSITORY}/manifests/${TAG_NEW}"