Error response from daemon: No such container

Ranjith Udayakumar picture Ranjith Udayakumar · Feb 28, 2019 · Viewed 7.4k times · Source

I am new to docker, I am using Alibaba Cloud ECS Instance and just following the Documentation but while trying these steps I got an error:

xxx@ubuntu:~$ docker run -t -i training/qbots /bin/bash
root@0de606236049:/# gem install json
Fetching: json-1.8.3.gem (100%)
Building native extensions. This could take a while…
Successfully installed json-1.8.3
1 gem installed
Installing ri documentation for json-1.8.3…
Installing RDoc documentation for json-1.8.3…
root@0gf805966049:/# exit
exit
xxx@ubuntu:~$ docker commit -m “add json gem” -a “xxx” \ 0gf805966049 ouruser/qbots:v2
Error response from daemon: No such container: 0de606236049
xxx@ubuntu:~$

Answer

Deepak Kamat picture Deepak Kamat · Mar 2, 2019

Listing containers by running docker ps -aq can include containers that have been removed. Attempting to perform an operation on a container that was included in the output of docker ps -aq, for example docker rm -f, results in the error Error response from daemon: No such container.

Workaround: Run docker rm -f again.

Let me know if that helps.