2020-03-30 11:44:56 +02:00
|
|
|
#!/bin/bash
|
2020-11-10 10:33:09 +01:00
|
|
|
set -x
|
2020-03-30 11:44:56 +02:00
|
|
|
|
|
|
|
IP=$1
|
|
|
|
USER=$2
|
|
|
|
PWD=$3
|
|
|
|
TARGET=$4
|
|
|
|
BUNDLE_FILE=$5
|
2020-11-10 10:33:09 +01:00
|
|
|
DOCKER_USER=$6
|
|
|
|
DOCKER_PWD=$7
|
|
|
|
echo $DOCKER_USER
|
2020-03-30 11:44:56 +02:00
|
|
|
echo $IP
|
|
|
|
|
2020-11-10 10:33:09 +01:00
|
|
|
TOKEN=$(curl --user "$DOCKER_USER:$DOCKER_PWD" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
|
|
|
|
curl -v -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit
|
|
|
|
|
|
|
|
docker login -u $DOCKER_USER -p $DOCKER_PWD
|
2020-03-30 11:44:56 +02:00
|
|
|
docker login $IP -u $USER -p $PWD
|
2020-11-10 10:33:09 +01:00
|
|
|
|
2020-03-30 11:44:56 +02:00
|
|
|
cnab-to-oci fixup $BUNDLE_FILE --target $TARGET --bundle fixup_bundle.json --auto-update-bundle
|
2020-11-10 10:33:09 +01:00
|
|
|
|
|
|
|
TOKEN=$(curl --user "$DOCKER_USER:$DOCKER_PWD" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
|
|
|
|
curl -v -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit
|
|
|
|
|
2020-03-30 11:44:56 +02:00
|
|
|
cnab-to-oci push fixup_bundle.json --target $TARGET --auto-update-bundle
|