From da181e5c4fc028b3870d3fd2c37d3ad8589e109e Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Thu, 10 May 2018 15:36:16 +0800 Subject: linux/docker: install docker-ce from upstream When docker not pre-installed, install docker-ce from upstream as it is already available on ARM now. Refer to: https://get.docker.com/ Change-Id: If6b7d953e1770f847be8b9b85a56c66bf01d356b Signed-off-by: Chase Qi --- automated/linux/docker/docker.sh | 29 ++++++++++++++++++++--------- automated/linux/docker/docker.yaml | 5 ++++- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/automated/linux/docker/docker.sh b/automated/linux/docker/docker.sh index a770642..c67a617 100755 --- a/automated/linux/docker/docker.sh +++ b/automated/linux/docker/docker.sh @@ -21,17 +21,28 @@ done ! check_root && error_msg "You need to be root to run this script." create_out_dir "${OUTPUT}" - -dist_name -# shellcheck disable=SC2154 -case "${dist}" in - debian) pkgs="docker-ce" ;; - fedora|centos) pkgs="docker" ;; - *) error_msg "Unsupported distribution" ;; -esac +cd "${OUTPUT}" || exit + +install_docker() { + which docker && return + + dist_name + # shellcheck disable=SC2154 + case "${dist}" in + debian|ubuntu|fedora|centos) + install_deps curl + curl -fsSL get.docker.com -o get-docker.sh + sh get-docker.sh + ;; + *) + warn_msg "No package installation support on ${dist}" + error_msg "And docker not pre-installed, exiting..." + ;; + esac +} skip_list="start-docker-service run-docker-image" -install_deps "${pkgs}" +install_docker exit_on_fail "install-docker" "${skip_list}" skip_list="run-docker-image" diff --git a/automated/linux/docker/docker.yaml b/automated/linux/docker/docker.yaml index c09cc7d..45c4fc5 100644 --- a/automated/linux/docker/docker.yaml +++ b/automated/linux/docker/docker.yaml @@ -1,12 +1,15 @@ metadata: name: docker format: "Lava-Test-Shell Test Definition 1.0" - description: "Ensure that Docker can be used" + description: "Docker smoke test. When docker not pre-installed, + docker-ce will be installed from upstream on supported + distributions." maintainer: - nicolas.dechesne@linaro.org - chase.qi@linaro.org os: - debian + - ubuntu - fedora - centos scope: -- cgit v1.2.3