docker提交失败,返回“0”;没有这样的id“;
通过docker教程学习如何在mac上使用docker: 正在尝试更新和提交映像。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 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