CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
htr-tech

CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.

GitHub Repository: htr-tech/zphisher
Path: blob/master/run-docker.sh
Views: 3095
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"
30
31