Skip to content

Commit

Permalink
Resolve merge conflicts with main
Browse files Browse the repository at this point in the history
  • Loading branch information
mhairifin committed Aug 13, 2024
2 parents 382e9f7 + 8057d74 commit ec78980
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions run-docker.sh
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

0 comments on commit ec78980

Please sign in to comment.