diff options
author | Ruijing Guo <ruijing.guo@intel.com> | 2018-07-05 07:37:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-07-05 07:37:34 +0000 |
commit | 20518dc93167aff1c83bf2995acc3e75e5a02c3d (patch) | |
tree | 9f56a081ad539891e27685644a49abe77b1fcd8e /src/vagrant/kubeadm_onap/registry_setup.sh | |
parent | 349aae43a3538b3dec63b41aded13895bc9770a4 (diff) | |
parent | df07077974d3af161184ba3f768e9e37deefeb6f (diff) |
Merge "rebase onap oom to beijing release"
Diffstat (limited to 'src/vagrant/kubeadm_onap/registry_setup.sh')
-rw-r--r-- | src/vagrant/kubeadm_onap/registry_setup.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/vagrant/kubeadm_onap/registry_setup.sh b/src/vagrant/kubeadm_onap/registry_setup.sh new file mode 100644 index 0000000..669268b --- /dev/null +++ b/src/vagrant/kubeadm_onap/registry_setup.sh @@ -0,0 +1,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 |