arch

yay -S docker docker-compose nvidia-container-toolkit
sudo systemctl enable docker.service

sudo usermod -aG docker $USER

docker completion fish > ~/.config/fish/completions/docker.fish
sudo nvidia-ctk runtime configure --runtime=docker

# usage
docker run -it --gpus all -p 5000:5000 -v host_dir:container_dir image_name user_cmds

docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -f "dangling=true" -q)

$cat /etc/docker/daemon.json

{
    "dns": [
        "223.5.5.5",
        "114.114.114.114"
    ],
    "registry-mirrors": [
        "https://docker.m.daocloud.io",
        "https://mirror.ccs.tencentyun.com",
        "https://hub-mirror.c.163.com"
    ],
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "nvidia-container-runtime"
        }
    }
}