Files
azure-storage-emulator/run.sh

28 lines
819 B
Bash
Executable File

#!/usr/bin/env bash
AZURITE_DIR="${AZURITE_DIR:-./storage}"
CONTAINER_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
-o|--oauth)
# OAuth support
CONTAINER_ARGS+=("--oauth")
shift
;;
*)
echo "Unknown argument: $1" >&2
exit 1
;;
esac
done
if command -v dockerd &> /dev/null; then
docker run --rm -d --name azurite --env-file accounts.env -p 443:443 -v "$AZURITE_DIR":/storage azurite:latest "${CONTAINER_ARGS[@]}"
elif command -v container &> /dev/null; then
container run --rm -d --name azurite --env-file accounts.env -p 443:443 --mount type=bind,source="$AZURITE_DIR",target=/storage azurite:latest "${CONTAINER_ARGS[@]}"
else
echo "Neither supported container runtime found." >&2
exit 1
fi