mongodb-memory-server: When running inside docker, mongoServer.getConnectionString() hangs
mongodb-memory-server: 6.1.1
node: v12.14.0
I started a docker container that runs node, and executed the following commands:
const MongodbMemoryServer = require('mongodb-memory-server').MongoMemoryServer;
const mongoServer = new MongodbMemoryServer();
(async () => {
await mongoServer.getConnectionString();
console.log('Done');
})();
Done
is never printed, whereas outside docker this works fine
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 34 (1 by maintainers)
Commits related to this issue
- build(devcontainer): support in-memory mongodb for tests The solution was taken from here: https://github.com/nodkz/mongodb-memory-server/issues/254#issuecomment-586190137 — committed to Kibibit/achievibit by thatkookooguy 3 years ago
- build(devcontainer): support in-memory mongodb for tests The solution was taken from here: https://github.com/nodkz/mongodb-memory-server/issues/254#issuecomment-586190137 — committed to Kibibit/achievibit by thatkookooguy 3 years ago
- build(devcontainer): support in-memory mongodb for tests The solution was taken from here: https://github.com/nodkz/mongodb-memory-server/issues/254#issuecomment-586190137 — committed to Kibibit/achievibit by thatkookooguy 3 years ago
- build(devcontainer): support in-memory mongodb for tests The solution was taken from here: https://github.com/nodkz/mongodb-memory-server/issues/254#issuecomment-586190137 — committed to Kibibit/achievibit by thatkookooguy 3 years ago
@firstnoises
no it wouldnt, because mongodb-memory-server checks if the file already exists when yes, dont download it again, and when you not use
-global
package, it will be installed into<project root>/node_modules/.cache/mongodb-binaries
(global will install it to~/.cache/mongodb-binaries
so, either install and use the
-global
package, or clear your node_modules/.cache every time, or dont mount it