Files
install_scripts/docker_installers/debian_docker_installer.sh

28 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Remove any older installations of Docker
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do
sudo apt-get remove -y $pkg
done
# Update the package database and install required packages
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg lsb-release
# Add Dockers official GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set up the stable repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update the package database with the Docker packages from the newly added repo
sudo apt-get update
# Install Docker Engine, CLI, Containerd, and Docker Compose
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Run a test Docker container to verify the installation
sudo docker run hello-world