• Docker 部署


    1 完全清除旧版本docker

    for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
    

    Images, containers, volumes, and networks stored in /var/lib/docker/ aren't automatically removed when you uninstall Docker. If you want to start with a clean installation,To delete all images, containers, and volumes:

    1. sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
    2. sudo rm -rf /var/lib/docker
    3. sudo rm -rf /var/lib/containerd

    2  安装docker Get DOcker

    2.0 离线安装

    1. Go to   docker download
    2. Go to pool/stable/ and select the applicable architecture (amd64armhfarm64, or s390x).

    3. Download the following deb files for the Docker Engine, CLI, containerd, and Docker Compose packages:

      • containerd.io__.deb
      • docker-ce__.deb
      • docker-ce-cli__.deb
      • docker-buildx-plugin__.deb
      • docker-compose-plugin__.deb
    4. install all the deb
      1. sudo dpkg -i ./containerd.io_<version>_<arch>.deb \
      2. ./docker-ce_<version>_<arch>.deb \
      3. ./docker-ce-cli_<version>_<arch>.deb \
      4. ./docker-buildx-plugin_<version>_<arch>.deb \
      5. ./docker-compose-plugin_<version>_<arch>.deb

       2.1  X86_64在线安装docker-ce

    1. sudo apt update
    2. sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
    3. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    4. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    5. sudo apt update
    6. sudo apt install docker-ce -y
    7. sudo systemctl enable docker

    3 Docker 常用命令 

    • docker  save -o  xxx.tar images_name
    • docker load -i xxx.tar
    • 启动 imaes as container  sudo docker run -it --runtime=nvidia -v /data:/work  images_name /bin/bash
    • sudo docker run -d -it --runtime nvidia -v /data:/work  images_name /bin/bash(后台运行)
    • docker  exec -it id  /bin/bash #进入容器,前提是必须执行上面步骤
    • docker  exec -d id  /bin/bash /opt/command #后台进入docker 执行指令

    4 更新docker里的文件,并打包成新镜像

          参考链接 

  • 相关阅读:
    maven 上传本地jar包到nexus
    2023计算机毕业设计SSM最新选题之java企业员工信息管理系统677du
    GAN实现mnist生成
    大厂Java面试过程中怎么谈项目经历呢?
    Qt6.3.2下QChart的使用
    Clickhouse 使用DBeaver连接
    FDCAN硬件过滤器详解
    再战:软件项目导论
    PWM点灯
    《羊了个羊》一夜爆红?产品运营带来的巨大红利
  • 原文地址:https://blog.csdn.net/Colin_xuan/article/details/133919233