-
Notifications
You must be signed in to change notification settings - Fork 5
/
pull-retag-push-images.sh
executable file
·132 lines (125 loc) · 3.04 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
set -e
# Reset SECONDS
SECONDS=0
if type apt; then
# Install and start docker
[[ -f /usr/share/keyrings/docker-archive-keyring.gpg ]] || (curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg)
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker
sudo systemctl start docker
else
# 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/9/$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
fi
# 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
registry=quay.io
acct=openstack.kolla
if type apt; then
tag=${1:-2023.1-ubuntu-jammy}
else
tag=${1:-2023.1-rocky-9}
fi
images="bifrost-deploy
kolla-toolbox
haproxy
mariadb-server
mariadb-clustercheck
fluentd
cron
keepalived
neutron-server
neutron-l3-agent
neutron-metadata-agent
neutron-openvswitch-agent
neutron-dhcp-agent
glance-api
nova-compute
keystone-fernet
keystone-ssh
keystone
nova-api
nova-conductor
nova-ssh
nova-novncproxy
nova-scheduler
placement-api
openvswitch-vswitchd
openvswitch-db-server
nova-libvirt
memcached
rabbitmq
heat-api
heat-api-cfn
heat-engine
horizon
opensearch
opensearch-dashboards
barbican-base
barbican-api
barbican-worker
barbican-keystone-listener
magnum-base
magnum-api
magnum-conductor
prometheus-alertmanager
prometheus-v2-server
prometheus-cadvisor
prometheus-haproxy-exporter
prometheus-mtail
prometheus-memcached-exporter
prometheus-blackbox-exporter
prometheus-node-exporter
prometheus-elasticsearch-exporter
prometheus-mysqld-exporter
prometheus-openstack-exporter
prometheus-libvirt-exporter
grafana
cinder-scheduler
cinder-volume
cinder-backup
cinder-api
ovn-controller
ovn-northd
ovn-nb-db-server
ovn-sb-db-server
dnsmasq
ironic-api
ironic-conductor
ironic-inspector
ironic-neutron-agent
ironic-pxe
nova-compute-ironic
manila-api
manila-share
manila-data
manila-scheduler"
for image in $images; do
echo "Processing $acct/$image:$tag..."
sudo docker pull $registry/$acct/$image:$tag
sudo docker tag $registry/$acct/$image:$tag localhost:4000/$acct/$image:$tag
sudo docker push localhost:4000/$acct/$image:$tag
sudo docker image remove $registry/$acct/$image:$tag
done
# Duration
duration=$SECONDS
echo "[INFO] $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."