I am in reference to Benjamin Muschko's Gradle-Docker plugin.
I use Mac OS X but some of my colleagues use Linux.
I would like to find a way to use the above plugin in order to retrieve the docker server IP and set that as an environment variable to use by my Spring Boot application.
I could do it manually by issuing a docker-machine ip <machineName>
but I need to do this programmatically through gradle so that I can just run my app from gradle which will:
- Retrieve the docker server IP
- Set it as an env variable (e.g.
$DOCKER_IP
) - My Spring Boot app will then use that variable in order to connect to Mysql and Elasticsearch on the docker host.
Is this possible to do that in a generic way so that it will work under Mac Os X and Linux?