new reposiroty created because old one broken
This commit is contained in:
parent
7689ae0b31
commit
6ce5e47e22
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 scriptos
|
||||
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:
|
||||
|
||||
|
17
README.md
17
README.md
@ -1,2 +1,17 @@
|
||||
# linux-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
46
docker-installer.v1.sh
Normal 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
56
docker-installer.v2.sh
Normal 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
51
docker-installer.v3.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user