Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
docker提交失败,返回“0”;没有这样的id“;_Docker - Fatal编程技术网

docker提交失败,返回“0”;没有这样的id“;

docker提交失败,返回“0”;没有这样的id“;,docker,Docker,通过docker教程学习如何在mac上使用docker: 正在尝试更新和提交映像。 收到我不理解的错误消息 $docker pull training/sinatra Pulling repository training/sinatra ... 79e6bf39f993: Download complete Status: Downloaded newer image for training/sinatra:latest $docker run -t -i training/sinat

通过docker教程学习如何在mac上使用docker:

正在尝试更新和提交映像。
收到我不理解的错误消息

$docker pull training/sinatra
Pulling repository training/sinatra
...
79e6bf39f993: Download complete 
Status: Downloaded newer image for training/sinatra:latest

$docker run -t -i training/sinatra /bin/bash

root@6a2012d33405:/# gem install json
Fetching: json-1.8.2.gem (100%)
Building native extensions.  This could take a while...    
Successfully installed json-1.8.2
1 gem installed
Installing ri documentation for json-1.8.2...
Installing RDoc documentation for json-1.8.2...

root@6a2012d33405:/# exit
exit

$docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
...
hello-world         latest              91c95931e552        6 weeks ago         910 B
training/sinatra    latest              f0f4ab557f95        11 months ago       447 MB

$docker commit -m "Added json gem" -a "Yours Truly" f0f4ab557f95 ouruser/sinatra:v2
FATA[0000] Error response from daemon: no such id: f0f4ab557f95 

看起来我使用了错误的id。
“图像ID”与“容器ID”不同。
后者是提示中“root@”之后出现的内容root@6a2012d33405“
这项工作:

$docker commit -m "Added json gem" -a "Yours Truly" 6a2012d33405  ouruser/sinatra:v2
36c544150c9405934674b52ffc447519cb428c0526607276daab56025dfd6b11

$docker images
REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
ouruser/sinatra     v2                  36c544150c94        About a minute ago   452.1 MB
...
hello-world         latest              91c95931e552        6 weeks ago          910 B
training/sinatra    latest              f0f4ab557f95        11 months ago        447 MB