Mongorestore in a Dockerfile

前端 未结 5 820
借酒劲吻你
借酒劲吻你 2021-02-05 07:10

I want to create a Docker image that starts a mongo server and automatically restores from a previous mongodump on startup.


Here is my Dockerfile for

5条回答
  •  情书的邮戳
    2021-02-05 08:07

    the problem isn't with docker.

    If you look at the dockerfile for mongo it runs CMD ["mongod"] which starts the mongo service.

    You said FROM MONGO but you overwrote the CMD line. this means mongo never started via mongod. so try CMD mongod; mongorestore /home/dump

提交回复
热议问题