Last active
June 13, 2023 20:22
-
-
Save lemajes/c3a1a53a4277c031937c5b84fd26297e to your computer and use it in GitHub Desktop.
[Docker Auto Installer] Docker automated installer #linux #docker #installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update | |
apt-get install -y \ | |
linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual | |
apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
if [ -n "$(uname -a | grep Ubuntu)" ]; then | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
else | |
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/debian \ | |
$(lsb_release -cs) \ | |
stable" | |
fi | |
apt-get update | |
apt-get install -y docker-ce | |
apt-get update | |
apt-get install docker-compose-plugin | |
# majes non-root user | |
sudo groupadd docker | |
sudo usermod -aG docker xxx | |
newgrp docker # no reboot to take effect | |
sudo service docker restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment