Request for additional Docker run configuration parameters
Hi guys, Thanks for the great product!
It would be really useful if you would add a possibility to specify in config files some additional 'docker run' parameters, e.g. --net and --net-alias. At the moment, Meteor container runs in a default bridge network, which supports neither network aliases nor docker-embedded DNS. This means that we can not use mupx util to deploy an app into custom setup of docker environment with other services/micro-services, custom set up of mongodb in our own full-feature docker network, etc. Thus, we lose the docker's service discovery features (https://docs.docker.com/engine/userguide/networking/work-with-networks/).
As I understand, it is not a big deal to add a docker container settings section into the config, like it has already been done for logging parameters, and to use it as run parameters.
Thank you!
Hi @VasilySizov , We can discuss a proper API for providing docker options. We already have logs option covered. Maybe we could move them to a separate docker in mup.js.
@mnmtanish what do you think?
I think we have two ways to implement this: we can either have an abstraction from docker (so, make networking just another section in mup.js, like logs) or just create a settings section called like 'docker run parameters' to allow advanced users to pass parameters as they want without restrictions.
I would prefer the second way, because it allows a user to do what he/she wants and decouples config from concrete docker client api.
I also believe the second way is more appropriate. If we abstract these settings, users will have to learn docker configs, mup config and how they work together. The env argument is a special case so better leave it.
@madushan1000 Perhaps something like this will do. Can you check it out?
meteor: {
name: 'app',
path: '../app',
servers: {
one: {}, two: {}
},
env: {
ROOT_URL: 'app.com',
MONGO_URL: 'mongodb://localhost/meteor'
},
docker: {
image: 'madushan1000/meteord-test',
args: [
'--log-driver syslog',
'--log-opt syslog-address="udp://syslogserverurl.com:1234"',
],
},
},
@mnmtanish Yeah I think that way would be good.
Any progress on this?
I need to expose an additional port on the docker run command: -p 127.0.0.1:5555:5555
Is there any way to do this?
For now, I've just modified the start.sh template on my machine, but that only works because I have a single project.
@VasilySizov @madushan1000 @mnmtanish
Hi guys, just wondering if this functionality will be added? I am having trouble getting my Meteor app to communicate with my RabbitMQ container as I cannot add the --net parameter to the run command.
https://docs.docker.com/engine/reference/run/ Here are the docker run options if a PR wants to check against them but that might be overkill. One could check for instance if a volume to mount actually exists and provide an appropriate warning. How far would you want to take this @madushan1000 ? A separate accepted arguments configuration file probably isn't needed.
I would certainly recommend using a solution like this only if you have prior knowledge of docker and its run command. I am not convinced it merits to many checks and failsafes, since it is quite safe to assume that if you need to use that solution, you already know that you need to overwrite / add variables to the docker run command, and then, you probably know how they should be formatted. I might be mistaken tho. @MasterJames @madushan1000
yeah. rather than checking every option possible, adding a generic args array like @mnmtanish has mentioned is better I think. If the user wants to use an option, it's safe to assume he knows the correct usage.
Yes docker will provide warnings and errors, so simple is better.
+1 i also need to add microservices and extra port mapping to my mup deployment. Args array seems fine.
@madushan1000 TY for the merge. Could you please release to npm any time soon?