-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
IMAGE_NAME="${IMAGE_NAME:-imap-pipeline-core/imap-mag}" | ||
# Example: | ||
# ./run-docker.sh | ||
# ./run-docker.sh -i // for interactive debugging | ||
# ./run-docker.sh -i -e VARIABLE=some_value // for interactive debugging with VARIABLE env var set | ||
|
||
IMAGE_NAME="${IMAGE_NAME:-imap-pipeline-core/imap-mag}" | ||
|
||
# docker run --rm -it \ | ||
# --entrypoint /bin/bash \ | ||
# --env-file dev.env \ | ||
# -v /mnt/imap-data:/data \ | ||
# $IMAGE_NAME | ||
echo "Running $IMAGE_NAME with dev.env file" | ||
|
||
docker run --rm -it \ | ||
--env-file dev.env \ | ||
-v /mnt/imap-data:/data \ | ||
$IMAGE_NAME | ||
# check if the argument "DEBUG" or "-i" is passed | ||
if [ "$1" == "debug" ] || [ "$1" == "DEBUG" ] || [ "$1" == "-i" ]; then | ||
echo "Overriding entrypoint to be an interactive bash shell for debugging" | ||
docker run --rm -it \ | ||
--entrypoint /bin/bash \ | ||
--env-file dev.env \ | ||
-v /mnt/imap-data:/data \ | ||
$IMAGE_NAME | ||
elif [ -z "$1" ]; then # no args passed | ||
docker run --rm -it \ | ||
--env-file dev.env \ | ||
-v /mnt/imap-data:/data \ | ||
$IMAGE_NAME | ||
else | ||
echo "Extra arguments: $@" | ||
docker run --rm -it \ | ||
--env-file dev.env \ | ||
-v /mnt/imap-data:/data \ | ||
$@ $IMAGE_NAME | ||
fi |