This commit is contained in:
Your Name
2025-04-25 10:48:38 +12:00
parent 5dd4a9dce6
commit 5e8ec90064
25 changed files with 566 additions and 64 deletions

20
templates/watchtower/start.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
source "$(dirname "$0")/_common.sh"
load_env "$1" || die "Failed to load environment variables"
DOCKER_RUN_CMD="docker run -d \
--restart unless-stopped \
--name ${CONTAINER_NAME} \
-v /var/run/docker.sock:/var/run/docker.sock \
${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG}"
if ! create_and_start_container "$DOCKER_RUN_CMD"; then
die "Failed to start container ${CONTAINER_NAME}"
fi
# Check if the container is running
if ! _is_container_running "$CONTAINER_NAME"; then
die "Container ${CONTAINER_NAME} is not running"
fi
echo "Container ${CONTAINER_NAME} started"