-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeployDocker.sh
More file actions
32 lines (24 loc) · 1015 Bytes
/
DeployDocker.sh
File metadata and controls
32 lines (24 loc) · 1015 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
29
30
31
32
#!/bin/bash
# Installing essential packages
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common vim unzip iputils-ping jq
# Downloading docker install script
wget https://get.docker.com/ -O install_docker.sh
# Adding execute permission to the script
chmod +x install_docker.sh
# Running the script
sudo ./install_docker.sh
# Adding user to docker group
sudo usermod -aG docker $(whoami)
# Checking if Docker was installed successfully
if docker --version >/dev/null 2>&1; then
# Ensuring the directory exists
sudo mkdir -p /home/ubuntu/scripts
# Creating a flag file
echo "CTF{docker_setup_success}" | sudo tee /home/ubuntu/scripts/flag.txt > /dev/null
echo "Docker installation successful. Flag file created at /home/ubuntu/scripts/flag.txt"
else
echo "Docker installation failed. Flag file will not be created."
fi
# Completion message
echo "Setup complete! Please log out and back in to apply Docker group changes."