How to run mongorestore after mongod in docker How to run mongorestore after mongod in docker shell shell

How to run mongorestore after mongod in docker


Start your mongod container

docker run -d --name mymongod ... mongo ...

Start a 2nd container for mongorestore, linking it to the first:

docker run --link mymongod:db ... mongo mongorestore -h db ...

mongorestore will connect to the mymongod container via the alias db that docker creates based on the specified --link