我不能在docker镜像中提交更改

我从https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04学习docker。

而且我在“第6步 – 将容器中的更改提交到Docker镜像”中遇到问题。

当我运行命令docker run -it ubuntu我得到了容器的交互式shell访问,并在命令行我得到例如: root@aaa73f6c6614:/#我可以使用shell。 但是当我想在安装nodejs之后提交更改时,我必须使用命令exit交互式shell并在命令行中写入: docker commit -m "node.js" -a "Me" aaa73f6c6614 finid/ubuntu-nodejs但是我得到了以下错误: Error response from daemon: No such container: aaa73f6c6614/Ubuntu-NodeJS

为什么我不能提交更改,我该怎么做?

(我使用Ubuntu 16.04)

只需要使用容器ID:

 docker commit -m "node.js" -a "Me" aaa73f6c6614 

然后你可以将你的容器标记为finid / ubuntu-nodejs

 docker tag aaa73f6c6614 finid/ubuntu-nodejs:latest