首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从图像创建停靠容器

如何从图像创建停靠容器
EN

Ask Ubuntu用户
提问于 2022-03-11 16:44:23
回答 1查看 94关注 0票数 0

我有以下图片:

代码语言:javascript
复制
REPOSITORY               TAG         IMAGE ID       CREATED       SIZE
nvcr.io/nvidia/pytorch   18.04-py3   c3555fec4fe6   3 years ago   5.9GB
The goal is to use Ubuntu 18.04 with CUDA 10.2. 

现在我想用这个图像创建一个容器。以下是我尝试过的命令:

docker image tag nvcr.io/nvidia/pytorch:18.04-py3 pytorch

docker run pytorch

但这是一个错误:

代码语言:javascript
复制
docker: Error response from daemon: 
mkdir /var/lib/docker/containers/22346b8352726ee06780791c3ee37c138b8c4b3d600225502266916e57902c56: 
no such file or directory.
EN

回答 1

Ask Ubuntu用户

发布于 2022-03-21 08:45:46

对于标记图像克隆并运行以下操作:

列出图像

代码语言:javascript
复制
# docker images
REPOSITORY                           TAG       IMAGE ID       CREATED         
SIZE
jupyter/datascience-notebook         latest    f5573d8505f2   4 months ago    4.14GB
centos                               latest    5d0da3dc9764   6 months ago    231MB

标记您的图像并检查新的克隆

代码语言:javascript
复制
[root@local ~]# docker tag centos:latest centos_1:clone
[root@local ~]# docker images
REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE
jupyter/datascience-notebook         latest    f5573d8505f2   4 months ago    4.14GB
centos                               latest    5d0da3dc9764   6 months ago    231MB
centos_1                             clone     5d0da3dc9764   6 months ago    231MB

将克隆映像作为容器运行

代码语言:javascript
复制
[root@local ~]# docker run -it 5d0da3dc9764 bash
[root@99d655eb9ef0 /]#
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1397120

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档