#!/bin/sh # Open a shell on one of the DBT-2 Docker images. ENGINE="podman" if ! which $ENGINE > /dev/null 2>&1; then ENGINE="docker" if ! which $ENGINE > /dev/null 2>&1; then echo "podman nor docker in path" exit 1 fi fi usage() { echo "usage: `basename $0` dbt2-base" echo "usage: `basename $0` dbt2-client " echo "usage: `basename $0` dbt2-database " echo "usage: `basename $0` dbt2-driver" } DBMS="" DBT2_TAG="" CONTAINER_TAG="" SF="" if [ $# -lt 1 ] || [ $# -gt 3 ]; then usage exit 1 fi DBT2_TAG="$1" if [ $# -eq 1 ]; then if [ ! "x$DBT2_TAG" = "xdbt2-base" ] && \ [ ! "x$DBT2_TAG" = "xdbt2-driver" ]; then usage exit 1 fi CONTAINER_TAG="$DBT2_TAG" fi DBMS="$2" if [ $# -eq 2 ]; then if [ ! "x$DBT2_TAG" = "xdbt2-client" ]; then usage exit 1 fi CONTAINER_TAG="${DBT2_TAG}-${DBMS}" fi SF="$3" if [ $# -eq 3 ]; then if [ ! "x$DBT2_TAG" = "xdbt2-database" ]; then usage exit 1 fi CONTAINER_TAG="${DBT2_TAG}-${DBMS}-${SF}w" fi $ENGINE run --rm -i -t ${CONTAINER_TAG} /bin/bash