I want to create a Docker image that starts a mongo server and automatically restores from a previous mongodump on startup.
mongodump
Here is my Dockerfile for
the problem isn't with docker.
If you look at the dockerfile for mongo it runs CMD ["mongod"] which starts the mongo service.
CMD ["mongod"]
You said FROM MONGO but you overwrote the CMD line. this means mongo never started via mongod. so try CMD mongod; mongorestore /home/dump
FROM MONGO
CMD
mongod
CMD mongod; mongorestore /home/dump