docker exe打包深度学习环境

该文提供了在Ubuntu系统上安装Docker,包括普通Docker和NVIDIADocker的详细步骤,并介绍了如何使用Dockerfile打包深度学习环境,涉及Opencv依赖库和共享内存的处理。此外,还提到了使用conda-pack进行环境迁移的方法。
摘要由CSDN通过智能技术生成

1.参考博客:

Docker打包深度学习项目-CSDN博客

1. 

docker的安装使用,及打包深度学习环境【很详细】_docker打包环境_明里MX的博客-CSDN博客

2.
Docker打包深度学习项目(解决:Opencv依赖库、共享内存) - 知乎

3

Docker 镜像构建之 Dockerfile - 知乎

4.Docker深度学习环境安装、部署、打包 - 知乎

5.使用conda pack进行环境迁移(步骤很详细)_小舟%的博客-CSDN博客

6.使用nvidia-docker创建gpu支持深度学习环境的容器_蔡逸超的博客-CSDN博客

2.普通Docker和NVIDIA Docker安装

不同平台的Docker安装方式可以参考官方文档(Docker Install) ,我这里就用Ubuntu系统作为例子。

1.Install Docker Engine on Ubuntu | Docker Documentation

# Docker
#在首次在新的主机上安装Docker Engine之前,需要设置Docker存储库。之后,您可以从存储库中安装和更新Docker。
#1、更新apt包索引并安装包,以允许apt通过HTTPS使用存储库:
$ sudo apt-get update
$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
#2. 添加Docker的官方GPG密钥:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#添加docker官方gpg密钥,这里改成中科大镜像的
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg


#3、使用以下命令设置存储库:
$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"  
 
 #设置稳定版本库,也换成中科大的
 echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Docker engine,安装docker,默认是安装最新版
#1. 更新apt包索引,安装最新版本的Docker Engine、containd和Docker Compose,或者执行下一步安装具体版本:
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

 sudo apt-get update
 sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
在完成安装后,执行下面命令,以确保安装成功:
sudo docker run hello-world

执行后看到打印出来正常的提示信息则表示安装成功。

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:10d7d58d5ebd2a652f4d93fdd86da8f265f5318c6a73cc5b6a9798ff6d2b2e67
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
7. 卸载
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-compose-plugin

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值