Skip to content

Instantly share code, notes, and snippets.

@flashgrimmie
Created August 9, 2021 19:37
Show Gist options
  • Save flashgrimmie/103a81484a7e74b20ac5230b71eb0dc1 to your computer and use it in GitHub Desktop.
Save flashgrimmie/103a81484a7e74b20ac5230b71eb0dc1 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