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 <chase.qi@linaro.org>
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 @@
 
 ! check_root && error_msg "You need to be root to run this script."
 create_out_dir "${OUTPUT}"
+cd "${OUTPUT}" || exit
 
-dist_name
-# shellcheck disable=SC2154
-case "${dist}" in
-    debian) pkgs="docker-ce" ;;
-    fedora|centos) pkgs="docker" ;;
-    *) error_msg "Unsupported distribution" ;;
-esac
+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: