From eec43a4c53917b800d9b05ff5685d159ab90f706 Mon Sep 17 00:00:00 2001 From: j-porsche Date: Thu, 19 Aug 2021 09:43:34 +0200 Subject: [PATCH] Possiblity to choose between docker and podman from the command line (#5217) * Possiblity to choose between docker and podman from the command line * Update docker.sh --- ui/docker.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ui/docker.sh b/ui/docker.sh index 2af7570eab3..3a6b0b4d68f 100755 --- a/ui/docker.sh +++ b/ui/docker.sh @@ -29,5 +29,20 @@ DATE="$(date --iso-8601=seconds)" LABEL_DATE="--label \"org.opencontainers.image.created=${DATE}\"" GIT_REV="$(git rev-parse HEAD)" LABEL_GIT_REV="--label \"org.opencontainers.image.revision=${GIT_REV}\"" - +USE_PODMAN=0 +USE_DOCKER=0 +OPTIONS='pd' +while getopts $OPTIONS OPTION +do + case "$OPTION" in + p)USE_PODMAN=1;; + d)USE_DOCKER=1;; + *)echo "Please choose between -p for podman or -d for docker." + exit;; + esac +done +if [[ $USE_PODMAN -eq 1 ]]; then + podman build -t cloudstack-ui ${LABEL_DATE} ${LABEL_GIT_REV} ${LABEL_GIT_TAG} . + exit +fi docker build -t cloudstack-ui ${LABEL_DATE} ${LABEL_GIT_REV} ${LABEL_GIT_TAG} .