You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Database initialisation scripts and custom db path #148
I use FROM mongo in Dockerfiles that occasionally setup custom mongo db paths.
It would be useful to have the initialisation scripts work in these circumstances, currently initialisation scripts run repeatedly as /data/db is never initialised.
Detecting --dbpath on the command line isn't too hard. Detecting dbPath in a config file is a bit harder.
Another option could be using a "state" file, possibly one for each of the "user" and "init" steps, stored in the container somewhere on successful init. Was that approach considered/avoided for the current implementation?
I think most of these were to do database initialisation and avoid the /data/dbVOLUME definition. Some could probably just move to using the new init setup.
We didn't detect dbpath since that would require finding and parsing all config files along with the command line arguments. (We can cheat with postgres since it uses the PGDATA variable automatically).
We considered a state file somewhere in the image, but it doesn't help when deleting the container and starting a new version with the same database files.
I would say 👍 to using the new init rather than storing the db in the image. The union file system in use (aufs, overlay, etc) for image layers can have negative impact on high I/O.
Hi tianon, thanks for the swift response! I'm not sure I completely understand the problem, but will changing the container's internal db path to the default (i.e. /data/db) solve the problem (the /data problem at least)?
Activity
deployable commentedon Mar 22, 2017
I think most of these were to do database initialisation and avoid the
/data/dbVOLUMEdefinition. Some could probably just move to using the new init setup.yosifkit commentedon Mar 22, 2017
Sorry to break your Dockerfiles. 😞
We didn't detect dbpath since that would require finding and parsing all config files along with the command line arguments. (We can cheat with postgres since it uses the
PGDATAvariable automatically).We considered a state file somewhere in the image, but it doesn't help when deleting the container and starting a new version with the same database files.
I would say 👍 to using the new init rather than storing the db in the image. The union file system in use (aufs, overlay, etc) for image layers can have negative impact on high I/O.
deployable commentedon Mar 22, 2017
No worries, only testing using the new features.
Thanks for the details. It probably just needs a documentation line to say init doesn't support paths other than
/data/db.sdanieru commentedon Apr 25, 2017
Hi tianon, thanks for the swift response! I'm not sure I completely understand the problem, but will changing the container's internal db path to the default (i.e. /data/db) solve the problem (the /data problem at least)?