docker-nixpkgs/push-all
zimbatm d36bde09e3
skopeo: use insecure-policy
Not sure what this is about, but it prevents me from pushing.
2021-02-10 14:06:24 +01:00

22 lines
571 B
Bash
Executable file

#!/usr/bin/env bash
#
# Usage: ./push-all <registry> <image-prefix> <image-tag>
set -euo pipefail
registry=${1:-docker.io}
image_prefix=${2:-nixpkgs}
image_tag=${3:-latest}
releases_json=$(nix-instantiate --strict --eval --json)
echo "=== Pushing images to $registry"
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
file=$(echo "$releases_json" | jq -r ".\"$attr\"")
src=docker-archive://$file
dst=docker://$registry/$image_prefix/$attr:$image_tag
echo "--- attr=$attr src=$src dst=$dst"
skopeo copy --insecure-policy "$src" "$dst"
done
echo OK