blob: a057c16d1c94dbbc52c7720d38cc4c1bf3db2204 [file] [log] [blame]
Vasyl Saienko3cc01ca2023-09-25 12:23:43 +00001set -ex
2
3OS_CODENAME=$(lsb_release -c -s)
4DOCKER_DEFAULT_ADDRESS_POOL=10.10.1.0/16
5DOCKER_DEFAULT_ADDRESS_SIZE=24
6
7
8mkdir -p /etc/docker
9cat <<EOF > /etc/docker/daemon.json
10{
11 "default-address-pools": [
12 { "base": "${DOCKER_DEFAULT_ADDRESS_POOL}", "size": ${DOCKER_DEFAULT_ADDRESS_SIZE} }
13 ],
14 "log-driver": "json-file",
15 "log-opts": {
16 "max-size": "1g",
17 "max-file": "3"
18 }
19}
20EOF
21
22curl --retry 6 --retry-delay 5 -fsSL "${DOCKER_EE_URL}/gpg" | sudo apt-key add -
23add-apt-repository "deb [arch=amd64] ${DOCKER_EE_URL}/ ${OS_CODENAME} ${DOCKER_EE_RELEASE}"
24
25apt update
26
27DEBIAN_FRONTEND=noninteractive apt install -y docker-ee
28
29image_prefix=${DOCKER_UCP_IMAGE%/*}
30if [[ "$image_prefix" =~ .*\.mirantis\.net* ]]; then
31 for image in $(docker container run --rm --name ucp -v /var/run/docker.sock:/var/run/docker.sock ${DOCKER_UCP_IMAGE} images --list); do
32 docker pull "${image_prefix}/${image##*/}"
33 docker tag ${image_prefix}/${image##*/} mirantis/${image##*/}
34 done
35fi