首页 > 其他分享 >Deepin 20.9安装Docker

Deepin 20.9安装Docker

时间:2024-07-20 17:29:58浏览次数:13  
标签:amd64 deb 20.9 sudo Deepin https Docker com docker

1 离线安装Nvidia Driver

参考网址:
Deepin 20.9在GTX 1060显卡上安装Nvidia 550.100驱动

2 离线安装Docker Engine

  1. 卸载旧版本包
# 强制删除docker的缓存
docker system prune -a --force

# 卸载docker相关安装包
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
  1. 下载安装软件
    下载地址: https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/
wget https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/containerd.io_1.7.19-1_amd64.deb


wget https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/docker-ce-cli_27.0.3-1~debian.11~bullseye_amd64.deb

wget https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/docker-ce_27.0.3-1~debian.11~bullseye_amd64.deb

wget https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/docker-buildx-plugin_0.15.1-1~debian.11~bullseye_amd64.deb

wget https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/docker-compose-plugin_2.28.1-1~debian.11~bullseye_amd64.deb
  1. 安装相关软件
sudo dpkg -i ./containerd.io_1.7.19-1_amd64.deb \
./docker-ce-cli_27.0.3-1~debian.11~bullseye_amd64.deb \
./docker-ce_27.0.3-1~debian.11~bullseye_amd64.deb \
./docker-buildx-plugin_0.15.1-1~debian.11~bullseye_amd64.deb \
./docker-compose-plugin_2.28.1-1~debian.11~bullseye_amd64.deb
  1. 添加镜像源
# 添加镜像源
sudo vim /etc/docker/daemon.json

{
    "registry-mirrors": [
        "https://hub.uuuadc.top",
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com",
        "https://docker.anyhub.us.kg",
        "https://dockerhub.jobcher.com",
        "https://dockerhub.icu",
        "https://docker.ckyl.me",
        "https://docker.awsl9527.cn",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://registry.docker-cn.com",
        "https://hub-mirror.c.163.com"
    ]
}

# 使配置生效
sudo systemctl daemon-reload

# 重启Docker
sudo systemctl restart docker
  1. 添加root权限
sudo groupadd docker          # 添加docker用户组
sudo usermod -aG docker $USER # 将当前用户添加到docker用户组
newgrp docker                 # 更新用户组
docker info                   # 测试docker命令是否可以使用sudo正常使用
reboot                        # 重启系统
  1. 验证安装成功
sudo service docker start

sudo docker run --rm hello-world

参考网址:

  1. Install Docker Engine on Ubuntu
  2. Manage Docker as a non-root user

7 离线安装Nvidia Container Toolkit

  1. 下载安装软件
    下载地址: https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/stable/debian11/
# libnvidia-container及其工具包
libnvidia-container1_1.13.5-1_amd64.deb
libnvidia-container-tools_1.13.5-1_amd64.deb

# nvidia-container-toolkit及其基础文件
nvidia-container-toolkit-base_1.13.5-1_amd64.deb
nvidia-container-toolkit_1.13.5-1_amd64.deb

# nvidia-container-runtime
nvidia-container-runtime_3.13.0-1_all.deb

# nvidia-docker2
nvidia-docker2_2.13.0-1_all.deb

# libnvidia-container开发调试包(一般不需要安装)
libnvidia-container-dev_1.13.5-1_amd64.deb
libnvidia-container1-dbg_1.13.5-1_amd64.deb
  1. 安装相关软件
# 安装相关软件
sudo dpkg -i ./libnvidia-container1_1.13.5-1_amd64.deb \
./libnvidia-container-tools_1.13.5-1_amd64.deb \
./nvidia-container-toolkit-base_1.13.5-1_amd64.deb \
./nvidia-container-toolkit_1.13.5-1_amd64.deb \
./nvidia-container-runtime_3.13.0-1_all.deb \
./nvidia-docker2_2.13.0-1_all.deb

# 修复依赖关系
sudo apt-get install -f
  1. 添加镜像源
# 添加镜像源
sudo vim /etc/docker/daemon.json

{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },
    "registry-mirrors": [
        "https://hub.uuuadc.top",
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com",
        "https://docker.anyhub.us.kg",
        "https://dockerhub.jobcher.com",
        "https://dockerhub.icu",
        "https://docker.ckyl.me",
        "https://docker.awsl9527.cn",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://registry.docker-cn.com",
        "https://hub-mirror.c.163.com"
    ]
}

# 使配置生效
sudo systemctl daemon-reload

# 重启Docker
sudo systemctl restart docker
  1. 验证安装成功
sudo systemctl restart docker

docker run --gpus all --rm nvcr.io/nvidia/cuda nvidia-smi

参考网址:

  1. 配置 Docker 使用 GPU
  2. Ubuntu20.04 arm64/amd64 离线安装nvidia-docker2
  3. docker 使用gpu
  4. libnvidia-container
  5. NVIDIA Container Toolkit repository
  6. Docker 配置国内镜像源加速

标签:amd64,deb,20.9,sudo,Deepin,https,Docker,com,docker
From: https://www.cnblogs.com/d442130165/p/18313458

相关文章

  • Deepin 20.9在GTX 1060显卡上安装Nvidia 550.100驱动
    1下载对应版本的显卡驱动下载地址:https://www.nvidia.com/Download/index.aspxhttps://www.nvidia.cn/geforce/drivers/https://www.nvidia.cn/drivers/lookup/https://developer.nvidia.cn/cuda-gpushttps://developer.nvidia.com/cudnnwgethttps://cn.download.nvidi......
  • Docker简介
    微服务虽然具备各种各样的优势,但服务的拆分通用给部署带来了很大的麻烦。分布式系统中,依赖的组件非常多,不同组件之间部署时往往会产生一些冲突。在数百上千台服务中重复部署,环境不一定一致,会遇到各种问题。一、Docker的优势(1)应用部署的环境问题(依赖兼容问题)大型项......
  • 05. Kubernetes基础篇-Docker知识
    常用命令dockerinfo查看docker信息#客户端信息Client:DockerEngine-CommunityVersion:26.1.4Context:defaultDebugMode:falsePlugins:buildx:DockerBuildx(DockerInc.)Version:v0.14.1Path:/usr/libexec/docker/cli-plu......
  • Docker部署wordpress-6.6
    目录一.环境准备二.准备对应的配置文件三.编写Dockerfile四.构建镜像五.配置MySQL 六.安装wordpress 七.扩展一.环境准备localhost192.168.226.25rocky_linux9.4Dockerversion27.0.3关闭防火墙和selinux,进行时间同步。安装docker#step1:安装必......
  • docker 创建 oracle 11g
    参考【DB宝11】在Docker中只需2步即可拥有Oracle11g企业版环境(11.2.0.3)拉取镜像#从Dockerhub下载,网络不好时,一般比较慢dockerpulllhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0#可以选择从阿里云下载dockerpullregistry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_......
  • maven项目容器化运行之2-maven中使用docker插件调用远程docker构建服务并在1Panel中运
    一.背景    公司主机管理小组的同事期望我们开发的maven项目能够在1Panel管理的docker容器部署。上一篇写了先开放1Panel中docker镜像构建能力maven项目容器化运行之1-基于1Panel软件将docker镜像构建能力分享给局域网-CSDN博客。这一篇就是演示maven工程的镜像构建、......
  • Docker群晖docker查询注册表失败
    解决群晖NASUI(或SSH中)的dockerpull错误(无法拉取,注册表错误)朗读全文Yourbrowserdoesnotsupporttheaudioelement.有什么用errorpullingimageconfiguration:Get"https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/...dialtcp......
  • Docker搭建BT-Tracker服务器贡献BT网络Tracker节点
    为畅享BT下载体验,(BT下载或做种)请添加Tracker:http://tracker.carlzeng.top:6969/announce长期自主自觉维护朗读全文Yourbrowserdoesnotsupporttheaudioelement.有什么用搭建BTTracker服务器,自建公共的BT网络Tracker节点为畅享更快BT下载体验,请给添加本站BTTrac......
  • docker创建基础镜像
    1.编写dockerfileFROMcentos:7.9.2009#替换默认的yum源RUNrm-f/etc/yum.repos.d/*\&&curl-o/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo\&&yummakecacheRUNyum-yupdate&&\......
  • docker安装
    docker三大核心概念镜像:images,即软件,里面包含了一个微型操作系统+核心代码程序+依赖库环境--》镜像文件越小越好dockerload导入镜像,dockerload-imysql-5-7-41.tardockersave导出镜像如dockersave-omysql-5-7-41.tarmysql:5.7.41仓库:存放镜像的地方容器:运行镜......