-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
launch docker-machine to get environment #437
Conversation
Signed-off-by: Chas Honton <chas@honton.org>
what happens if is there a way to disable this functionality and just have the same behavior as now? i don't think this should be the default behavior and instead the user should have to enable it explicitly. |
The idea is, if its not installed, everything is the same as now. I.e. it should be last in the fallback chain, so, if your It's only that in the case you dont have a |
but even if i have there should be a way to change the name of the i also don't think we should create a new |
Agree with having not too much magic. Would it be ok that by default we would us a docker-machine if it is installed and only one machine is created, then we use that as a fallback. From my feeling if people have docker-machine installed, they have this for a reason. If more thane one machine is found then I would bail out, but also have an option e.g. like Could we agree on this ? |
well - here's the thing...if we are going to offer the ability to create a for instance, i do have if we want to keep things simple to start, we can just say that a machine instance is created w/ the defaults but i'd still like to see a way that someone can opt out of the plugin making any |
I haven't tested this scenario yet. Is it reasonable to expect that if you are using this plugin, you have docker-machine installed?
Why I suggested this ability is for jenkins remote jobs. I can easily ensure that docker-machine is available on the jenkins slaves. I'd like it easy to make sure there is a basic machine available. If no machine is available, the If you want/need particular machine with esoteric options used, then make sure it's set up ahead of the build as the only active machine. Or, make sure that |
i don't really think the use of as long as there is a way to opt out of using |
Agreed that this should be opt-in. I'm wondering what's the best way of indicating opt-in. Maybe specifying the machine name in a configuration element. |
@chonton @jgangemi I suggest to use configuration variable If this configuration variable is set, then docker-machine should be used with the given value as machine name. In that case there also should be no fallback but an error if docker-machine is not available because the user explicitly required docker-machine and would be surprised about any magic. If the variable is not set, I would suggest to fallback to docker-machine, but only as last resort and only if only a single docker-machine is already present. To tune this, one could always set I agree with @jgangemi that we shouldn't create a docker machine automatically by default. However I could imagine to have either an extra property wdyt ? |
i still think we should have a simple boolean that says |
The TestContainers library (https://github.com/testcontainers/testcontainers-java) apparently calls The TestContainers logic is described here, but just for reference it's basically environment variables if present, then docker-machine (first machine): http://testcontainers.viewdocs.io/testcontainers-java/#user-content-docker-environment-discovery It would be nice to harmonise the variable names if practical, since I could see projects wanting to use both plugins. I would vote for sensible defaults if no other config is available, rather than an error message. It's always nice if |
I just grepped for "machine" in the TestContainers code, and it looks like the current implementation:
(But I'm sure the environment variables still trump that logic if present.) TestContainers does not create a machine for you. Docker Machine Quickstart Terminal does that though, if you have run it. Anyway, just another reference point. |
Continued in #481 |
If docker environment variables are not set, use docker-machine to get what should be the environment variables.
Since this is a time consuming process, cache results for other mojo executions in same Maven session