2024-07-27 04:15:43 +05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
|
|
echo -e "\033[31mThis script requires superuser rights.\033[0m"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-08-31 02:26:12 +05:00
|
|
|
trap 'echo -e "\033[31minit-docker.sh: Something went wrong\033[0m"; exit 1' ERR
|
2024-07-27 04:15:43 +05:00
|
|
|
set -e
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2024-08-08 05:49:11 +05:00
|
|
|
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
|
2024-07-27 04:15:43 +05:00
|
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
|
|
|
|
add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
|
2024-08-08 05:49:11 +05:00
|
|
|
apt-get update -y
|
|
|
|
apt-get install -y docker-ce
|
2024-07-27 04:15:43 +05:00
|
|
|
|
2024-08-31 02:26:12 +05:00
|
|
|
echo "Creating docker network proxynet..."
|
|
|
|
docker network create proxynet
|
|
|
|
|
|
|
|
trap - ERR
|
2024-07-27 04:15:43 +05:00
|
|
|
echo "Docker installed"
|