Files
azure-storage-emulator/run.sh

27 lines
771 B
Bash
Executable File

#!/usr/bin/env bash
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 -it --name azurite --env-file accounts.env -p 443:443 -v ./storage:/storage azurite:latest "${CONTAINER_ARGS[@]}"
elif command -v container &> /dev/null; then
container run --rm -it --name azurite --env-file accounts.env -p 443:443 --mount type=bind,source=./storage,target=/storage azurite:latest "${CONTAINER_ARGS[@]}"
else
echo "Neither supported container runtime found." >&2
exit 1
fi