From cf58a12fb009e8831cb1d98ab5d3cfc048e8b6a2 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Wed, 12 Jul 2017 09:58:08 +0800 Subject: [PATCH] Use latest docker ce in gate Change-Id: I1cb6189cec2704edfc461538ef593d38e81ca343 --- tools/setup_Debian.sh | 24 +++++------------------- tools/setup_RedHat.sh | 13 ++++--------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/tools/setup_Debian.sh b/tools/setup_Debian.sh index 7b088722ac..76e5dc3b61 100755 --- a/tools/setup_Debian.sh +++ b/tools/setup_Debian.sh @@ -3,22 +3,6 @@ set -o xtrace set -o errexit -function add_key { - local counter=0 - - while :; do - if [[ "${counter}" -gt 5 ]]; then - echo "Failed to add Docker keyring" - exit 1 - fi - # hkp://pool.sks-keyservers.net intermittently doesn't have the correct - # keyring. p80 is what the docker script pulls from and what we should - # use for reliability too - sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && break || : - sleep 5 - done -} - function setup_disk { if [ ! -f /swapfile ]; then sudo swapoff -a @@ -54,10 +38,12 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" source /etc/lsb-release # Setup Docker repo and add signing key -echo "deb http://apt.dockerproject.org/repo ubuntu-${DISTRIB_CODENAME} main" | sudo tee /etc/apt/sources.list.d/docker.list -add_key sudo apt-get update -sudo apt-get -y install --no-install-recommends 'docker-engine=1.13.1*' +sudo apt-get -y install apt-transport-https +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +sudo apt-get update +sudo apt-get -y install --no-install-recommends docker-ce sudo service docker stop if [[ ${DISTRIB_CODENAME} == "trusty" ]]; then diff --git a/tools/setup_RedHat.sh b/tools/setup_RedHat.sh index 490f825632..043d4ff262 100755 --- a/tools/setup_RedHat.sh +++ b/tools/setup_RedHat.sh @@ -35,16 +35,11 @@ function setup_disk { # (SamYaple)TODO: Remove the path overriding export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -sudo tee /etc/yum.repos.d/docker.repo << EOF -[docker] -name=Docker Main Repository -baseurl=https://yum.dockerproject.org/repo/main/centos/7 -enabled=1 -gpgcheck=1 -gpgkey=https://yum.dockerproject.org/gpg -EOF +sudo yum-config-manager \ + --add-repo \ + https://download.docker.com/linux/centos/docker-ce.repo -sudo yum -y install libffi-devel openssl-devel docker-engine{,-selinux}-1.13.1 btrfs-progs +sudo yum -y install libffi-devel openssl-devel docker-ce btrfs-progs # Disable SELinux setenforce 0