forked from stackhpc/terraform-aufn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pull-retag-push-images.sh
executable file
·85 lines (77 loc) · 2.63 KB
/
pull-retag-push-images.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -e
# Reset SECONDS
SECONDS=0
# Install and start docker
sudo dnf install -y 'dnf-command(config-manager)'
cat << "EOF" | sudo tee /etc/yum.repos.d/docker-ce.repo
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/8/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
module_hotfixes = True
EOF
sudo dnf install -y docker-ce iptables
sudo systemctl enable docker
sudo systemctl start docker
# Set MTU of default interface to 1400 so that images can download from Docker Hub without timing out
sudo ip link set mtu 1400 dev `ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)'`
# Start the registry if it does not exist
if [ ! "$(sudo docker ps -q -f name=registry)" ]; then
sudo docker run -d -p 4000:5000 --restart=always --name registry registry
fi
tag=${1:-victoria}
images="kolla/centos-binary-kolla-toolbox
kolla/centos-binary-haproxy
kolla/centos-binary-mariadb-server
kolla/centos-binary-mariadb-clustercheck
kolla/centos-binary-fluentd
kolla/centos-binary-cron
kolla/centos-binary-keepalived
kolla/centos-binary-neutron-server
kolla/centos-binary-neutron-l3-agent
kolla/centos-binary-neutron-metadata-agent
kolla/centos-binary-neutron-openvswitch-agent
kolla/centos-binary-neutron-dhcp-agent
kolla/centos-binary-glance-api
kolla/centos-binary-nova-compute
kolla/centos-binary-keystone-fernet
kolla/centos-binary-keystone-ssh
kolla/centos-binary-keystone
kolla/centos-binary-nova-api
kolla/centos-binary-nova-conductor
kolla/centos-binary-nova-ssh
kolla/centos-binary-nova-novncproxy
kolla/centos-binary-nova-scheduler
kolla/centos-binary-placement-api
kolla/centos-binary-openvswitch-vswitchd
kolla/centos-binary-openvswitch-db-server
kolla/centos-binary-nova-libvirt
kolla/centos-binary-memcached
kolla/centos-binary-rabbitmq
kolla/centos-binary-chrony
kolla/centos-binary-heat-api
kolla/centos-binary-heat-api-cfn
kolla/centos-binary-heat-engine
kolla/centos-binary-horizon
kolla/centos-binary-kibana
kolla/centos-binary-elasticsearch
kolla/centos-binary-barbican-base
kolla/centos-binary-barbican-api
kolla/centos-binary-barbican-worker
kolla/centos-binary-barbican-keystone-listener
kolla/centos-binary-magnum-base
kolla/centos-binary-magnum-api
kolla/centos-binary-magnum-conductor
kolla/centos-source-bifrost-deploy"
for image in $images; do
sudo docker pull $image:$tag
sudo docker tag docker.io/$image:$tag localhost:4000/$image:$tag
sudo docker push localhost:4000/$image:$tag
sudo docker image remove docker.io/$image:$tag
done
# Duration
duration=$SECONDS
echo "[INFO] $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."