Skip to content

Commit 4fed673

Browse files
committed
Wrapper script for Docker
1 parent b4b27a4 commit 4fed673

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

run-docker.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# I'm not that familiar with docker. Send a PR if something is wrong (^.^)
4+
5+
BASE_DIR=$(realpath "$(dirname "$BASH_SOURCE")")
6+
if [[ ! -d "$BASE_DIR/auth" ]]; then
7+
echo "Creating Auth Directory.."
8+
mkdir -p "$BASE_DIR/auth"
9+
fi
10+
11+
CONTAINER="zphisher"
12+
IMAGE="htrtech/zphisher:latest"
13+
IMG_MIRROR="ghcr.io/htr-tech/zphisher:latest"
14+
MOUNT_LOCATION=${BASE_DIR}/auth
15+
check_container=$(docker ps --all --format "{{.Names}}")
16+
17+
if [[ ! $check_container == $CONTAINER ]]; then
18+
echo "Creating new container..."
19+
docker create \
20+
--interactive --tty \
21+
--volume ${MOUNT_LOCATION}:/zphisher/auth/ \
22+
--network host \
23+
--name "${CONTAINER}" \
24+
"${IMAGE}"
25+
fi
26+
27+
docker start --interactive "${CONTAINER}"
28+
29+
# docker run --rm -ti --network="host" -v ${MOUNT_LOCATION}:/zphisher/auth/ --name "$CONTAINER" "$IMAGE"

0 commit comments

Comments
 (0)