Asif Ahmed
Asif Ahmed

Reputation: 187

Unable to start docker mongodb

I am running this following command

docker start mongodb

getting the error as follows, how to fix it.

Error response from daemon: failed to update store for object type *libnetwork.endpointCnt: Key not found in store
Error: failed to start containers: mongodb

Upvotes: 1

Views: 13171

Answers (2)

ashikpatel
ashikpatel

Reputation: 166

Create a data directory on your host system, e.g. /var/lib/data. Start your mongo container like this:

$ docker run --name my-mongo-container -v /var/lib/data:/data/db -d mongo:latest

The -v /var/lib/data:/data/db part of the command mounts the /var/lib/data directory from the underlying host system as /data/db inside the container, where MongoDB by default will write its data files.

Hope it helps!

Upvotes: 1

Star.Kid
Star.Kid

Reputation: 200

The docker seems unable to get the image. Try running docker images command to see if the image is still there. Then use docker search mongodb and run the latest official image from the list. This should resolve the issue.

Upvotes: 1

Related Questions