User Tools

Site Tools


docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docker [2025/11/22 13:08] – created reddydocker [2026/04/27 10:50] (current) – [Ubuntu] reddy
Line 16: Line 16:
 # curl -fsSL https://get.docker.com -o get-docker.sh | bash # curl -fsSL https://get.docker.com -o get-docker.sh | bash
 </code> </code>
 +
 +===== Ubuntu =====
 +
 +<code bash>
 +#!/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
 +
 +usermod -a -G docker ubuntu
 +docker run hello-world
 +</code>
 +
 +===== Windows =====
 +
 +If you already installed Docker Desktop, you can start the Docker Engine as a daemon with:
 +
 +<code>
 +C:\Program Files\Docker\Docker\resources/dockerd.exe --register-service
 +</code>
 +
 +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:
 +
 +<code>
 +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
 +</code>
 +
docker.1763813288.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki