Last active
November 18, 2024 02:51
-
-
Save PvtSec/4b1a968de1e3a6c8eaa6527c75bf9d84 to your computer and use it in GitHub Desktop.
Docker installer (Debian)
This file contains hidden or 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 | |
| # Remove existing packages | |
| sudo apt purge docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc -y | |
| sudo apt autoremove -y | |
| # Add Docker's official GPG key: | |
| sudo apt update | |
| sudo apt install ca-certificates curl gnupg -y | |
| 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 | |
| # Add the repository to Apt sources: | |
| 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 | |
| sudo apt update | |
| sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment