Skip to content

Instantly share code, notes, and snippets.

@scootcho
Forked from mtrunkat/docker-mongo-repair
Created July 26, 2021 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scootcho/0f08820f7d80332ca95d7c3d65d969a6 to your computer and use it in GitHub Desktop.
Save scootcho/0f08820f7d80332ca95d7c3d65d969a6 to your computer and use it in GitHub Desktop.
Run "mongo --repair" in Docker container that cannot start because of MongoDB error
#!/bin/bash
# See https://github.com/docker-library/mongo/pull/63
docker run --rm --volumes-from my-mongo-server mongo unlink "/data/db/mongod.lock"
docker run --rm --volumes-from my-mongo-server mongo --repair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment