fix: use variable for AZURITE_IMAGE in docker run commands

This commit is contained in:
2026-02-28 19:52:02 +01:00
parent c8ac9ddebf
commit 93fb89446d

View File

@@ -2,6 +2,7 @@
AZURITE_DIR="${AZURITE_DIR:-$(pwd)}"
CONTAINER_ARGS=()
AZURITE_IMAGE="${AZURITE_IMAGE:-azurite:latest}"
while [[ $# -gt 0 ]]; do
case "$1" in
@@ -27,9 +28,9 @@ while [[ $# -gt 0 ]]; do
done
if command -v dockerd &> /dev/null; then
docker run --rm -d --name azurite --env-file "$AZURITE_DIR/accounts.env" -p 443:443 -v "$AZURITE_DIR/storage":/storage azurite:latest "${CONTAINER_ARGS[@]}"
docker run --rm -d --name azurite --env-file "$AZURITE_DIR/accounts.env" -p 443:443 -v "$AZURITE_DIR/storage":/storage "$AZURITE_IMAGE" "${CONTAINER_ARGS[@]}"
elif command -v container &> /dev/null; then
container run --rm -d --name azurite --env-file "$AZURITE_DIR/accounts.env" -p 443:443 --mount type=bind,source="$AZURITE_DIR/storage",target=/storage azurite:latest "${CONTAINER_ARGS[@]}"
container run --rm -d --name azurite --env-file "$AZURITE_DIR/accounts.env" -p 443:443 --mount type=bind,source="$AZURITE_DIR/storage",target=/storage "$AZURITE_IMAGE" "${CONTAINER_ARGS[@]}"
else
echo "Neither supported container runtime found." >&2
exit 1