Force apt-get to ipv4 01/1101/2
authorJingzhao.Ni <Jingzhao.Ni@arm.com>
Tue, 2 Jul 2019 03:16:46 +0000 (11:16 +0800)
committerJingzhao.Ni <Jingzhao.Ni@arm.com>
Tue, 2 Jul 2019 04:49:53 +0000 (12:49 +0800)
For avoiding docker-ce installation failed, we specify the apt to
ipv4 network on ubuntu system. The correpsonding scripts was added
into k8s_common.sh

Signed-off-by: Jingzhao.Ni <Jingzhao.Ni@arm.com>
Change-Id: I94c25067e89064f63e62a59ab12db53c74fc6554

src/foundation/scripts/k8s_common.sh

index 975b43c..d9c536f 100755 (executable)
@@ -28,11 +28,12 @@ esac
 case ${OS_ID_LIKE:-} in
 debian)
   # Install basic software
+  echo "Acquire::ForceIPv4 \"true\";" | sudo tee -a /etc/apt/apt.conf.d/99force-ipv4 > /dev/null
   sudo apt update
   sudo apt install -y software-properties-common apt-transport-https curl
 
   # Install Docker as Prerequisite
-  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
+  curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
   sudo apt-key fingerprint 0EBFCD88
   sudo add-apt-repository \
     "deb https://download.docker.com/linux/ubuntu \