Compare commits

...

12 Commits

Author SHA1 Message Date
scriptos
573d23d11a testfile added 2024-02-24 19:03:42 +01:00
scriptos
4da6588617 testfile added 2024-02-24 19:02:01 +01:00
scriptos
4a83c0a7ab testfile added 2024-02-24 18:55:51 +01:00
scriptos
9decad541e testfile added 2024-02-24 18:46:34 +01:00
scriptos
fb2a50e940 description shortened 2024-02-24 18:43:04 +01:00
scriptos
804d8df381 user is now added to the docker group earlier 2024-02-24 18:24:19 +01:00
scriptos
0c2f11d129 sudo systemctl stop docker 2024-02-24 18:21:31 +01:00
scriptos
f6295efbd3 move old directory 2024-02-24 18:13:08 +01:00
scriptos
5fc736cdda allow modification of docker root directory 2024-02-22 22:49:50 +01:00
scriptos
0dc737ac2f initial commit 2023-08-01 12:40:27 +02:00
scriptos
eec43d3c3a initial commit 2023-08-01 12:38:55 +02:00
scriptos
091885cd51 initial commit 2023-08-01 12:37:55 +02:00
6 changed files with 176 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2023 | Patrick Asmus | scriptOS
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@@ -1,2 +1,17 @@
# docker-installer
# Docker Installer v3 für Ubuntu-Systeme
## Beschreibung
Das Skript "docker-installer-v3.sh" ermöglicht die Installation von Docker und Docker-Compose auf einem Ubuntu-System. Es richtet auch das Docker-Plugin für Oh My ZSH ein, um Docker-Befehle direkt in der ZSH-Shell verwenden zu können.
## Voraussetzungen
Stellen Sie sicher, dass Sie über eine Verbindung zum Internet verfügen und dass Sie als Benutzer mit sudo-Berechtigungen angemeldet sind, da das Skript administrative Berechtigungen benötigt, um Docker zu installieren.
## Verwendung
Führen Sie das Skript mit dem folgenden Befehl in einem Terminal aus:
```bash
bash ./docker-installer.v3.sh
```

46
docker-installer.v1.sh Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
##########################################################################################
# .--.
# |o_o |
# |:_/ |
# // \ \
# (| | )
# /'\_ _/`\
# \___)=(___/
# _ _ _ _ _ _
# __| | ___ ___ | | __ ___ _ __ (_) _ __ ___ | |_ __ _ | || | ___ _ __
# / _` | / _ \ / __|| |/ // _ \| '__|_____ | || '_ \ / __|| __|/ _` || || | / _ \| '__|
#| (_| || (_) || (__ | <| __/| | |_____|| || | | |\__ \| |_| (_| || || || __/| |
# \__,_| \___/ \___||_|\_\\___||_| |_||_| |_||___/ \__|\__,_||_||_| \___||_|
#
# (c) Patrick Asmus
# support@media-techport.de
# https://www.media-techport.de
##########################################################################################
# Last Update: 06. November 2021
# Version 1.0.2
##########################################################################################
clear
sleep 2
exec > >(tee -i "/var/log/docker-installer.log")
exec 2>&1
HOSTNAME="$(hostname)"
#Globale Funktion zur Aktualisierung und Bereinigung der Umgebung
function update_and_clean {
apt update
apt full-upgrade -y
apt autoclean -y
apt autoremove -y
}
#START
sleep 2
update_and_clean
apt install sudo -y
apt install docker-compose docker docker.io -y
mkdir /docker
touch /docker/docker-compose.yaml
echo OhMyZSH Plugin für Docker hinzufügen
sudo sed -i 's/plugins=(git)/plugins=(git docker)/g' /root/.zshrc
echo Fertig. Zeit fuer ein Bierchen.
cat /dev/null > ~/.bash_history && history -c && history -w
exit 0

56
docker-installer.v2.sh Normal file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
##########################################################################################
# .--.
# |o_o |
# |:_/ |
# // \ \
# (| | )
# /'\_ _/`\
# \___)=(___/
# _ _ _ _ _ _
# __| | ___ ___ | | __ ___ _ __ (_) _ __ ___ | |_ __ _ | || | ___ _ __
# / _` | / _ \ / __|| |/ // _ \| '__|_____ | || '_ \ / __|| __|/ _` || || | / _ \| '__|
#| (_| || (_) || (__ | <| __/| | |_____|| || | | |\__ \| |_| (_| || || || __/| |
# \__,_| \___/ \___||_|\_\\___||_| |_||_| |_||___/ \__|\__,_||_||_| \___||_|
#
# (c) Patrick Asmus
# support@media-techport.de
# https://www.media-techport.de
##########################################################################################
# Last Update: 14. Oktober 2022
# Version 2.0.1
##########################################################################################
clear
sleep 2
exec > >(tee -i "/var/log/docker-installer2.log")
exec 2>&1
HOSTNAME="$(hostname)"
#Globale Funktion zur Aktualisierung und Bereinigung der Umgebung
function update_and_clean {
apt update
apt full-upgrade -y
apt autoclean -y
apt autoremove -y
}
#START
sleep 2
update_and_clean
apt install sudo -y
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release -y
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
update_and_clean
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
mkdir /docker
sudo service docker start
sudo service docker enable
sudo docker run hello-world
echo Fertig. Zeit fuer ein Bierchen.
exit 0

51
docker-installer.v3.sh Normal file
View File

@@ -0,0 +1,51 @@
#!/bin/bash
# Script Name: docker-installer.v3.sh
# Beschreibung: Docker & Docker-Compose installieren und Docker-Root-Verzeichnis ändern (Für Ubuntu)
# Aufruf: bash ./docker-installer.v3.sh
# Autor: Patrick Asmus
# Web: https://www.media-techport.de
# Git-Reposit.: https://git.media-techport.de/scriptos/docker-installer
# Version: 3.1.2
# Datum: 24.02.2024
# Modifikation: user is now added to the docker group earlier
#####################################################
# Variablen
USER="root"
DOCKER_ROOT_DIR="/docker"
COMPOSE_DIR="/compose"
# Docker installieren
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
# Docker-Root-Verzeichnis ändern
sudo systemctl stop docker
sudo mkdir -p $DOCKER_ROOT_DIR
echo "{\"data-root\": \"$DOCKER_ROOT_DIR\"}" | sudo tee /etc/docker/daemon.json
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
sudo apt install -y curl
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Optional: Plugin für Oh my ZSH aktivieren
echo "OhMyZSH Plugin für Docker hinzufügen"
sudo sed -i 's/plugins=(git)/plugins=(git docker)/g' /root/.zshrc
# Überprüfen der Installation
docker --version
docker-compose --version
exit 0

6
testfile.txt Normal file
View File

@@ -0,0 +1,6 @@
test
cccc
test
testfile added