From a050d636177fe94ca58d9379dd1f2bc30ed0b7eb Mon Sep 17 00:00:00 2001 From: morvencao Date: Fri, 22 Mar 2019 18:14:52 +0800 Subject: [PATCH] fix docker version issue. --- .../user-data/ubuntu/templates/master-user-data.sh | 3 ++- .../user-data/ubuntu/templates/worker-user-data.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/master-user-data.sh b/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/master-user-data.sh index f2386e020a..156fd9769e 100644 --- a/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/master-user-data.sh +++ b/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/master-user-data.sh @@ -55,7 +55,8 @@ function install_configure_docker () { echo "exit 101" > /usr/sbin/policy-rc.d chmod +x /usr/sbin/policy-rc.d trap "rm /usr/sbin/policy-rc.d" RETURN - apt-get install -y docker.io + docker_version=$(apt-cache policy docker.io | grep 18.06 | awk '{print $1}' | head -n1) + apt-get install -y docker.io=${docker_version} echo 'DOCKER_OPTS="--iptables=false --ip-masq=false"' > /etc/default/docker # Reset iptables config diff --git a/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/worker-user-data.sh b/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/worker-user-data.sh index f00c37bf3e..5aacac9354 100644 --- a/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/worker-user-data.sh +++ b/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/worker-user-data.sh @@ -26,7 +26,8 @@ function install_configure_docker () { echo "exit 101" > /usr/sbin/policy-rc.d chmod +x /usr/sbin/policy-rc.d trap "rm /usr/sbin/policy-rc.d" RETURN - apt-get install -y docker.io + docker_version=$(apt-cache policy docker.io | grep 18.06 | awk '{print $1}' | head -n1) + apt-get install -y docker.io=${docker_version} echo 'DOCKER_OPTS="--iptables=false --ip-masq=false"' > /etc/default/docker # Reset iptables config