Skip to content

Commit 4878972

Browse files
committed
fix bash script to use env bash instead of system bash
This allows the script to be run using bash 5.1+
1 parent 401e032 commit 4878972

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/create-docker-container.bash

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eu
44
set -o pipefail
@@ -14,15 +14,17 @@ if [[ ${DB:-empty} == "empty" ]]; then
1414
DB=mysql
1515
fi
1616

17+
TAG=${TAG:-latest}
18+
1719
CONTAINER_NAME="$REPO_NAME-$DB-docker-container"
1820
if [[ "${DB}" == "mysql" ]] || [[ "${DB}" == "mysql-8.0" ]]; then
19-
IMAGE="docker.io/cloudfoundry/tas-runtime-mysql-8.0"
21+
IMAGE="docker.io/cloudfoundry/tas-runtime-mysql-8.0:${TAG}"
2022
DB="mysql"
2123
elif [[ "${DB}" == "mysql-5.7" ]]; then
22-
IMAGE="docker.io/cloudfoundry/tas-runtime-mysql-5.7"
24+
IMAGE="docker.io/cloudfoundry/tas-runtime-mysql-5.7:${TAG}"
2325
DB="mysql"
2426
elif [[ "${DB}" == "postgres" ]]; then
25-
IMAGE="docker.io/cloudfoundry/tas-runtime-postgres"
27+
IMAGE="docker.io/cloudfoundry/tas-runtime-postgres:${TAG}"
2628
else
2729
echo "Unsupported DB flavor"
2830
exit 1
@@ -47,4 +49,3 @@ docker run -it \
4749
${ARGS} \
4850
"${IMAGE}" \
4951
/bin/bash
50-

0 commit comments

Comments
 (0)