Closed
Description
High level
I'm trying to build a db into an image to deploy (read-only) in a k8s cluster. I need to be able to build it one environment and deploy in a completely different one.
Desired behavior
Ability to (within my Dockerfile):
- start
FROM mongo
, - launch the db in background (can use tmux for this)
- run script to populate db
- stop db
- commit as image
Blockers currently (/ other solutions if they would work)
- Because these images declare volumes for
/data/db
,- Docker generates an ephemeral volume whenever a descendant image is launched.
- Docker appears to not allow a client Dockerfile to "reset" volumes (like we can entrypoint and cmd),
- Nor have I been able to figure out how to get mongod to store the initial db in a different folder.
Metadata
Metadata
Assignees
Labels
No labels