I used official mongo image, but the service won’t start when i run “docker run” with start service parameter. For start a service, i need to enter in container and start service manually.
To run the service in the container, you shouldn’t need more than: docker pull mongo docker run -d -p 27017:27017 mongo
This will start the container with MongoDB running. You can verify this with a tool like Robo 3T (formerly Robomongo).
If you aren’t worried about saving the new version of your container, I would do the restore from a second container that is linked to the first: docker run --link mymongod:db ... mongo mongorestore -h db ...
If you need a new version of the container as part of the restore process, I recommend researching some of the scripts available for doing backups and restores. I would either utilize one of them as-is or use them as a guide to write your own.