From 51bf82f5d1b67e16a58c1c5baeaf6f0b564b12b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Gonz=C3=A1lez?= Date: Wed, 13 Dec 2023 16:20:46 +0200 Subject: [PATCH] Make a bit better the scripts --- scripts/dockerBuild | 33 +++++++++++++++++++++++++++------ scripts/dockerRun | 11 +++++------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/scripts/dockerBuild b/scripts/dockerBuild index 92eca9e..6f9c3f9 100755 --- a/scripts/dockerBuild +++ b/scripts/dockerBuild @@ -1,10 +1,31 @@ - - -# +#!/bin/bash +# # Usage: -# +# # buildDockerImage filer or # buildDockerImage taskmaster -# +# + +IMAGE=$1 + +if [ -z "$IMAGE" ]; +then + echo "Use: $0 [tag]" + exit 12 +fi + +TAG=$2 + +if [ -z "$TAG" ]; +then + TAG=testing +fi -docker build -t "eu.gcr.io/tes-wes/$1:testing" -f "containers/$1.Dockerfile" . +if command -V buildah; +then + buildah bud -t "docker.io/elixircloud/tesk-core-$IMAGE:$TAG" \ + --format=docker --no-cache \ + -f "containers/$IMAGE.Dockerfile" +else + docker build -t "docker.io/elixircloud/tesk-core-$1:$TAG" -f "containers/$1.Dockerfile" . +fi diff --git a/scripts/dockerRun b/scripts/dockerRun index 8c3b631..4bc8709 100755 --- a/scripts/dockerRun +++ b/scripts/dockerRun @@ -1,13 +1,12 @@ - -# +#!/bin/bash +# # Usage: -# +# # buildRun filer or # buildRun taskmaster -# +# imageName="$1" shift -docker run "eu.gcr.io/tes-wes/$imageName:testing" "$@" - +docker run "docker.io/elixircloud/tesk-core-$imageName:testing" "$@"