From 601f5a39f36cbc7728130cdaaddd6e25b71a0e5a Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 11 Jul 2018 11:49:33 +0200 Subject: [PATCH] fix: [host] force docker version for support of registry v1 --- precise/host/hooks/install.d/60-docker.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/precise/host/hooks/install.d/60-docker.sh b/precise/host/hooks/install.d/60-docker.sh index 89fc97fe..9911b09c 100755 --- a/precise/host/hooks/install.d/60-docker.sh +++ b/precise/host/hooks/install.d/60-docker.sh @@ -5,3 +5,13 @@ if ! type -p docker; then echo "Installing docker..." curl -sSL https://get.docker.io | sh fi + +version="$(apt-cache madison docker-ce | cut -f 2 -d \| | grep 17.06 | head -n 1 | xargs echo)" +## DOWNGRADE to 17.xx because 18.xx do not support registry v1 +apt-get install -y --force-yes docker-ce="$version" + +if ! egrep 'disable-legacy-registry' /lib/systemd/system/docker.service 2>/dev/null; then + sed -ri 's/^(ExecStart=.*)$/\1 --disable-legacy-registry=false/g' /lib/systemd/system/docker.service +fi +systemctl daemon-reload && +service docker restart