lots of shit

This commit is contained in:
2024-08-25 03:32:39 +02:00
parent e37329013a
commit 5db877355c
36 changed files with 1070 additions and 372 deletions

34
bin/helpers/docker.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env zsh
ensure_docker_installed() {
# if docker is already installed, skip the installation
if [ -x "$(command -v docker)" ]; then
printfe "%s\n" "green" " - Docker is already installed"
return
fi
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add Docker's repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
# Check if it successfully installed
if [ -x "$(command -v docker)" ]; then
printfe "%s\n" "green" " - Docker is installed"
else
printfe "%s\n" "red" " - Docker is not installed"
printfe "%s\n" "red" " Something went wrong while installing Docker, investigate the issue"
exit 1
fi
sudo usermod -aG docker $USER
sudo systemctl start docker
sudo systemctl enable docker
}