Page:
Docker Setup
No results
6
Docker Setup
Fr4nz D13trich edited this page 2025-10-02 18:36:25 +02:00
Table of Contents
Dependencies & Repo
- Install the required dependencies with the following apt command:
sudo apt install ca-certificates curl gnupg lsb-release
- Create key directory --if-not-exists
sudo mkdir -p /etc/apt/keyrings
- Download and add Docker's official GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- Add Docker's APT repository with:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- Update the package list:
sudo apt update
Install & Setup
- Install essential Docker packages with:
sudo apt install docker-ce docker-ce-cli containerd.io
- Add the user to the Docker group with:
sudo usermod -aG docker $USER
- Logout and back in or reboot host machine
Test Docker
To confirm Docker is running correctly, test the setup with a simple container. Run the "hello-world" container with the following docker run command:
docker run hello-world
Uninstall Docker
- Use the apt purge command to uninstall the Docker-related packages:
sudo apt purge docker-ce docker-ce-cli containerd.io
- To delete leftover data, run the following command:
sudo rm -rf /var/lib/docker