1
0
This commit is contained in:
James Brumond 2022-09-20 20:03:17 -07:00
parent cf96348c11
commit e3383cda60
Signed by: james
GPG Key ID: 24BA25B8B303B023
2 changed files with 0 additions and 20 deletions

View File

@ -9,8 +9,5 @@ RUN rc-update add docker boot
COPY docker-setup /bin/
RUN chmod +x /bin/docker-setup
COPY docker-remote-tag /bin/
RUN chmod +x /bin/docker-remote-tag
CMD [ "/bin/docker-setup" ]
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]

View File

@ -1,17 +0,0 @@
#!/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}"