diff --git a/.ci/run.sh b/.ci/run.sh index bf39686e35..27a4b71a21 100755 --- a/.ci/run.sh +++ b/.ci/run.sh @@ -9,10 +9,34 @@ set -e cidir=$(dirname "$0") source "${cidir}/lib.sh" +install_docker_ubuntu() { + pkg_name="docker-ce" + repo_url="https://download.docker.com/linux/ubuntu" + curl -fsSL "${repo_url}/gpg" | sudo apt-key add - + sudo -E add-apt-repository "deb [arch=${arch}] ${repo_url} $(lsb_release -cs) stable" + sudo -E apt-get update + docker_version_full=$(apt-cache madison $pkg_name | grep "$docker_version" | awk '{print $3}' | head -1) + sudo -E apt-get -y install "${pkg_name}=${docker_version_full}" +} + pushd "${tests_repo_dir}" .ci/run.sh testcidir=$(dirname "$0") +# make proto will fail on arm64 when use docker 18.06 and using docker 19.03 can avoid this failure +arch=$(go env GOARCH) +if [ "$arch" == "arm64" ]; then + docker_version=$(get_version "externals.docker.version") + docker_version=${docker_version/v} + docker_version=${docker_version/-*} + if [[ `echo "$docker_version < 19.03" | bc` -eq 1 ]]; then + docker_version=19.03 + fi + command -v docker >/dev/null 2>&1 && "${testcidir}/../cmd/container-manager/manage_ctr_mgr.sh" docker remove + echo "reinstall docker $docker_version for arm64" + install_docker_ubuntu $docker_version +fi + echo "Starting docker service before making proto" sudo systemctl start docker