Skip to content

Commit 23b45de

Browse files
matrixikryjones
authored andcommitted
Address comments to run_docker
Signed-off-by: Dobrosław Żybort <dobroslaw.zybort@fujitsu.com>
1 parent 1357671 commit 23b45de

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

scripts/run_docker

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ echo "Container name: ${ACAPY_CONTAINER_NAME}"
6161

6262
ACAPY_NETWORK_NAME="${NETWORK_NAME}"
6363
# Create new Docker network if it does not exist.
64-
if [ -n "${NETWORK_NAME}" ] && [ -z "$(docker network ls --filter name=^"${NETWORK_NAME}"$ --format="{{ .Name }}")" ]; then
65-
docker network create "${NETWORK_NAME}"
66-
fi
6764
if [ -n "${NETWORK_NAME}" ]; then
68-
echo "Docker network specified: ${ACAPY_NETWORK_NAME}"
65+
if [ -z "$("$CONTAINER_RUNTIME" network ls --filter name=^"${NETWORK_NAME}"$ --format="{{ .Name }}")" ]; then
66+
echo "Creating new Docker network: ${ACAPY_NETWORK_NAME}"
67+
"$CONTAINER_RUNTIME" network create "${NETWORK_NAME}"
68+
else
69+
echo "Attaching to existing Docker network: ${ACAPY_NETWORK_NAME}"
70+
fi
6971
ARGS="${ARGS} --network ${NETWORK_NAME}"
7072
else
7173
echo "No Docker network specified."

0 commit comments

Comments
 (0)