-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·28 lines (22 loc) · 813 Bytes
/
setup.sh
File metadata and controls
executable file
·28 lines (22 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -e
# Define your Docker Hub repo and tag
DOCKER_HUB_USERNAME="ravindu02"
REPOSITORY_NAME="cybertds"
TAG="v1.0"
# Full image name
IMAGE_NAME="${DOCKER_HUB_USERNAME}/${REPOSITORY_NAME}:${TAG}"
# Pull the image
echo "Pulling image ${IMAGE_NAME} from Docker Hub..."
docker pull "${IMAGE_NAME}"
# Set container name
CONTAINER_NAME="my-${REPOSITORY_NAME}"
# Check if container already exists
if [ "$(docker ps -aq -f name=^/${CONTAINER_NAME}$)" ]; then
echo "Container ${CONTAINER_NAME} already exists. Removing it first..."
docker rm -f "${CONTAINER_NAME}"
fi
# Run the container
echo "Running container ${CONTAINER_NAME}..."
docker run -it --network=host --cap-add=NET_ADMIN --cap-add=NET_RAW --name "${CONTAINER_NAME}" "${IMAGE_NAME}"
echo "Container ${CONTAINER_NAME} is now running!"