Last active
August 30, 2023 18:43
-
-
Save marcosricardoss/7b52d8c1870b0c58dec35f22abe75050 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# update the apt package index and install packages to allow apt to use a repository over HTTPS: | |
sudo apt-get update -y | |
sudo apt-get install ca-certificates curl gnupg -y | |
sudo apt-get install python3-pip | |
# add Docker’s official GPG key: | |
sudo install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
sudo chmod a+r /etc/apt/keyrings/docker.gpg | |
# set up the repository: | |
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
# install docker engine | |
sudo apt-get update | |
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
sudo docker run hello-world | |
# docker-compose | |
pip install -U docker-compose | |
docker-compose --version | |
# add the current user to the docker group. | |
sudo groupadd docker |
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
newgrp docker |
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
sudo usermod -aG docker $USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment