From 1e42f4ad44fac80c16960b196463ff6229cb350b Mon Sep 17 00:00:00 2001 From: Marius Grosu Date: Tue, 16 Dec 2025 18:29:45 +0200 Subject: [PATCH] First script for docker install --- .gitignore | 31 +++++++++++++++++++++++++++++ docker_install.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .gitignore create mode 100644 docker_install.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f2c1df --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# ---> macOS +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +#Custom file +.env diff --git a/docker_install.sh b/docker_install.sh new file mode 100644 index 0000000..08bbb4b --- /dev/null +++ b/docker_install.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Acest script ne ajuta la instalarea docker-ului pe o masina cu Ubuntu +# Creare functie pentru afisarea mesajelor de eroare + +function error_msg { + if [ $? -ne 0 ]; then + echo "Eroare: $1" + exit 1 + fi +} + +# Add Docker's official GPG key: +sudo apt update +error_msg "Actualizarea listei de pachete a esuat." + +# Install required packages: +sudo apt install ca-certificates curl +error_msg "Instalarea pachetului 'ca-certificates' sau 'curl' a esuat." + +# Create the /etc/apt/keyrings directory if it doesn't exist: +sudo install -m 0755 -d /etc/apt/keyrings +error_msg "Crearea directorului /etc/apt/keyrings a esuat." + +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc +error_msg "Descărcarea cheii GPG Docker a eșuat." + +# Set permissions for the GPG key: +sudo chmod a+r /etc/apt/keyrings/docker.asc +error_msg "Modificarea permisiunilor pentru cheia GPG Docker a eșuat." + + +# Add the repository to Apt sources: +sudo tee /etc/apt/sources.list.d/docker.sources <