Vasyl Saienko | 3cc01ca | 2023-09-25 12:23:43 +0000 | [diff] [blame] | 1 | set -ex |
| 2 | |
| 3 | OS_CODENAME=$(lsb_release -c -s) |
| 4 | DOCKER_DEFAULT_ADDRESS_POOL=10.10.1.0/16 |
| 5 | DOCKER_DEFAULT_ADDRESS_SIZE=24 |
| 6 | |
| 7 | |
| 8 | mkdir -p /etc/docker |
| 9 | cat <<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 | } |
| 20 | EOF |
| 21 | |
| 22 | curl --retry 6 --retry-delay 5 -fsSL "${DOCKER_EE_URL}/gpg" | sudo apt-key add - |
| 23 | add-apt-repository "deb [arch=amd64] ${DOCKER_EE_URL}/ ${OS_CODENAME} ${DOCKER_EE_RELEASE}" |
| 24 | |
| 25 | apt update |
| 26 | |
| 27 | DEBIAN_FRONTEND=noninteractive apt install -y docker-ee |
| 28 | |
| 29 | image_prefix=${DOCKER_UCP_IMAGE%/*} |
| 30 | if [[ "$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 |
| 35 | fi |