docker
This is an old revision of the document!
Table of Contents
Installing
Debian
apt update apt remove docker docker-engine docker.io containerd runc apt install -y apt-transport-https ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null apt update apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin # For dependency errors, apt install -f # Convenience script... # curl -fsSL https://get.docker.com -o get-docker.sh | bash
Ubuntu
#!/usr/bin/env bash sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc | cut -f1) # Add Docker's official GPG key: sudo apt update sudo apt install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: sudo tee /etc/apt/sources.list.d/docker.sources <<EOF Types: deb URIs: https://download.docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/apt/keyrings/docker.asc EOF sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo systemctl enable --now docker sudo docker run hello-world
Windows
If you already installed Docker Desktop, you can start the Docker Engine as a daemon with:
C:\Program Files\Docker\Docker\resources/dockerd.exe --register-service
Then, configure the service to start “Automatic (Delayed Start)”. Open “cmd” with Administrator privileges to run docker commands (first “docker context use default”).
Volumes
Within a docker compose file, you can define volumes that are on shared network file systems:
volumes:
nas-share:
driver_opts:
type: cifs
o: "username=[username],password=[password]"
device: "//my-nas/share"
volumes:
nfs-docker-upload:
driver_opts:
type: "nfs"
o: "addr=10.122.0.30,nfsvers=4.1,rw"
device: ":/volume1/docker/immich/upload"
services:
my-server:
container_name: my-server
image:my_server
volumes:
- nfs-docker-upload:/usr/src/app/upload
docker.1776888458.txt.gz · Last modified: by reddy
