Compare commits
2 Commits
0c35a87e1e
...
274387b780
Author | SHA1 | Date | |
---|---|---|---|
|
274387b780 | ||
|
61cd042347 |
@ -1,15 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Script Name: docker-installer.v3.sh
|
||||
# Beschreibung: Docker & Docker-Compose installieren und Docker-Root-Verzeichnis ändern (Für Ubuntu)
|
||||
# Beschreibung: Docker & Docker-Compose Installer für "Ubuntu 22.04 Jammy" only
|
||||
# Aufruf: bash ./docker-installer.v3.sh
|
||||
# Autor: Patrick Asmus
|
||||
# Web: https://www.techniverse.net
|
||||
# Git-Reposit.: https://git.techniverse.net/scriptos/docker-installer
|
||||
# Version: 3.2
|
||||
# Datum: 31.03.2024
|
||||
# Modifikation: Umstellung auf neue Domain
|
||||
# Git-Reposit.: https://git.techniverse.net/scriptos/linux-docker-installer
|
||||
# Version: 3.3
|
||||
# Datum: 08.04.2024
|
||||
# Modifikation: Script now checks OS before installation
|
||||
#####################################################
|
||||
|
||||
# Betriebssystem und Version prüfen
|
||||
OS=$(lsb_release -is)
|
||||
VERSION=$(lsb_release -rs)
|
||||
|
||||
if [ "$OS" != "Ubuntu" ] || [ "$VERSION" != "22.04" ]; then
|
||||
echo "Dieses Script ist nur für Ubuntu 22.04 geeignet. Installation abgebrochen."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Variablen
|
||||
USER="root"
|
||||
DOCKER_ROOT_DIR="/docker"
|
||||
@ -24,7 +33,7 @@ sudo apt update
|
||||
sudo apt install -y docker-ce docker-ce-cli containerd.io
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# Docker-Root-Verzeichnis ändern
|
||||
# Docker-Root-Verzeichnis ändern & Compose Verzeichnis erstellen
|
||||
sudo systemctl stop docker
|
||||
sudo mkdir -p $DOCKER_ROOT_DIR
|
||||
echo "{\"data-root\": \"$DOCKER_ROOT_DIR\"}" | sudo tee /etc/docker/daemon.json
|
||||
@ -32,7 +41,6 @@ cp /var/lib/docker/* $DOCKER_ROOT_DIR
|
||||
rm -R /var/lib/docker
|
||||
sudo systemctl start docker
|
||||
|
||||
# Erstelle Compose-Verzeichnis
|
||||
mkdir $COMPOSE_DIR
|
||||
|
||||
# Docker-compose installieren
|
||||
@ -48,4 +56,4 @@ sudo sed -i 's/plugins=(git)/plugins=(git docker)/g' /root/.zshrc
|
||||
docker --version
|
||||
docker-compose --version
|
||||
|
||||
exit 0
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user