Docker - Error response from daemon: No such container

2 min

language: ja bn en es hi pt ru zh-cn zh-tw

I noticed that Docker was spitting out an error, so here's a memo.

Error response from daemon: no such container when running docker compose up · Issue #309 · docker/desktop-linux · GitHub

It seems like something happened with a recent update.

Check

In my case, I had placed build images and such on an externally mounted HDD, but when I updated the version with pacman -Syu, I noticed that daemon.json had been overwritten and disappeared.

{
    "data-root": "/mnt/hdd1/docker-data",
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "nvidia-container-runtime"
        }
    }
}

After fixing the above, when I checked with docker ps, the container remained DEAD and for some reason, I couldn't delete it even when I tried. It felt like only the metadata was left?

Solution

As per the Issue thread at the beginning, I temporarily deleted the entire /mnt/hdd1/docker-data/containers directory.
I judged that it would be fine to delete it because persistent data is located in volumes.

sudo rc-service containerd stop
sudo rc-service docker stop

After deleting, I restarted from containerd and rebuilt the container, which resolved the issue.

Related Posts