blob: 669268b9eaa3a2a109d51af8dae5be500f275e85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash
set -ex
sudo apt-get update -y
sudo apt install -y jq docker.io
NEXUS_REPO=nexus3.onap.org:10001
LOCAL_REPO=192.168.0.2:5000
cat << EOF | sudo tee /etc/docker/daemon.json
{
"insecure-registries" : [ "$LOCAL_REPO" ]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker run -d -p 5000:5000 --restart=always --name registry registry:2
dockers=$(curl -X GET https://$NEXUS_REPO/v2/_catalog | jq -r ".repositories[]")
for d in $dockers
do
tags=$(curl -X GET https://$NEXUS_REPO/v2/$d/tags/list | jq -r ".tags[]")
for t in $tags
do
sudo docker pull $NEXUS_REPO/$d:$t
sudo docker tag $NEXUS_REPO/$d:$t $LOCAL_REPO/$d:$t
sudo docker push $LOCAL_REPO/$d:$t
done
done
|