dokku / dokku-mongo

a mongo plugin for dokku
MIT License
174 stars 32 forks source link

Cleaner mongo:create with image, version and options #37

Closed ebeigarts closed 8 years ago

ebeigarts commented 8 years ago

I'm guessing this will not work through ssh:

export MONGO_IMAGE="mongo"
export MONGO_IMAGE_VERSION="2.6.11"
export MONGO_CONFIG_OPTIONS=" --auth "
ssh <user>@dokku.<domain> -- mongo:create lolipop

Maybe we could implement something like:

dokku mongo:create lolipop mongo:2.6.11 --auth
# dokku mongo:create <name> [<image> [<options>]]

I think this applies also to dokku-postgres, etc.

WDYT?

josegonzalez commented 8 years ago

Maybe we could instead parse args like the new logs plugin in dokku code? Thoughts, @flink?

Flink commented 8 years ago

@josegonzalez yes we could do something like this maybe: ssh dokku@domain mongo:create my_app --image mongo --version 2.6.11 --extra-args "--auth"

malixsys commented 8 years ago

Can MONGO_CONFIG_OPTIONS be changed on an existing container (i.e. after mongo:create)?

josegonzalez commented 8 years ago

@malixsys no it cannot.

josegonzalez commented 8 years ago

Proposal for those who wish to implement this functionality:

# default create method
dokku mongo:create <service>

# specify an image
dokku mongo:create <service> --image mongo

# specify an image version
dokku mongo:create <service> --image-version 2.6.11

# specify config options
dokku mongo:create <service> --config-options " --auth "

# specify a password
dokku mongo:create <service> --password "CAMILA"

# specify a root password
dokku mongo:create <service> --root-password "FATMILA"

# specify custom environment
dokku mongo:create <service> --custom-env "USER=alpha;HOST=beta"

Other than the --config-options flag, all the rest would be generic enough that it can be implemented for all datastore plugins. I've had other people ask about these options, and it would certainly make it easier to administrate a remote dokku instance.

josegonzalez commented 8 years ago

Closing in favor of a rather large rfc here: dokku/dokku-redis/issues/64

josegonzalez commented 7 years ago

This is now implemented.