From b04e6f4b3bcd7a94f09f12029d370f5995dec6c2 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Thu, 30 Jan 2020 22:19:04 +0100 Subject: [PATCH] extra/travis-build: fallback to podman if docker is not available Signed-off-by: Maciek Borzecki --- extra/travis-build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extra/travis-build b/extra/travis-build index 0da87e5..4bbd611 100755 --- a/extra/travis-build +++ b/extra/travis-build @@ -140,7 +140,7 @@ build() { } build_in_container() { - install_deps $1 + install_deps "$1" # distro specific quirks case "$1" in @@ -172,12 +172,16 @@ spin_container() { exit 1 esac + engine="docker" + if ! command -v "$engine" 2>/dev/null ; then + engine="podman" + fi # run a container, mount sources at /mnt, st - docker run --rm \ - -v $PWD:/mnt \ + "$engine" run --rm \ + -v "$PWD":/mnt \ -w /mnt \ -e IN_CONTAINER=1 \ - $DOCKER_IMG \ + "$DOCKER_IMG" \ /mnt/extra/travis-build "$@" }