Skip to content

Commit

Permalink
Remove inapplicable RepoDigests check
Browse files Browse the repository at this point in the history
Checking RepoDigests is only possible if the images are retained locally
(not in the local registry). That is not the case anymore with --push.

An equivalent error should arise from the skopeo command if the image
is not first pushed to the local registry.
  • Loading branch information
victorlin authored Sep 13, 2022
1 parent d70f43a commit 9ca46fb
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions devel/localhost-to-dockerhub
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# This pushes just the provided tag. If "latest" is provided as a second argument,
# the provided tag will also be pushed as "latest"
#
# Errors if any of the tagged images have already been pushed.
#
set -euo pipefail

if [[ $# -lt 1 ]]; then
Expand All @@ -19,11 +17,6 @@ tag=$1
BASE_IMAGE="nextstrain/base"
BASE_BUILDER_IMAGE="nextstrain/base-builder"

if [[ $(docker image inspect --format "{{.RepoDigests}}" $BASE_IMAGE:$tag) != '[]' || $(docker image inspect --format "{{.RepoDigests}}" $BASE_BUILDER_IMAGE:$tag) != '[]' ]]; then
echo "At least one of $BASE_IMAGE:$tag and $BASE_BUILDER_IMAGE:$tag has already been pushed. This can happen if the newly built image is not available in the local registry." >&2
exit 1
fi

# copy local $tag to remote $tag
skopeo copy --multi-arch=all --src-tls-verify=false docker://localhost:5000/$BASE_IMAGE:$tag docker://docker.io/$BASE_IMAGE:$tag
skopeo copy --multi-arch=all --src-tls-verify=false docker://localhost:5000/$BASE_BUILDER_IMAGE:$tag docker://docker.io/$BASE_BUILDER_IMAGE:$tag
Expand Down

0 comments on commit 9ca46fb

Please sign in to comment.