arquillian / arquillian-cube

Control (docker, kubernetes, openshift) containers in your tests with ease!
http://arquillian.org/arquillian-cube/
120 stars 98 forks source link

boot2docker ip configuration in static wait strategy #164

Open fstab opened 9 years ago

fstab commented 9 years ago

As pointed out in the documentation, the static wait strategy is useful with boot2docker, because it allows polling for open ports on the docker host and not on the docker container.

However, there are some issues with the configuration of the ip address for static polling:

1) Although the configuration property is named ip, it has to be a hostname. Putting an actual ip address fails. 2) It is not possible to use the special string dockerServerIp, the boot2docker address has to be statically configured.

As a workaround, I put boot2docker's IP in /etc/hosts and give it a hostname, which makes my tests not portable and not self-contained.

lordofthejars commented 9 years ago

Hi first of all thank you very much for using Cube. As you said it may be really useful that you will be able to use dockerServerIp at static ip.

But also we have changed a lot in the last Arquillan cube release everything related to boot2docker/dockermachine and how to work with await. Currently yo don't need to set any await strategy specifically. The default ones works in all possible environments, and most important without having to set anything (ip, hostname, ...) since it is auto-resolved. In this example https://github.com/javaee-samples/javaee-arquillian-cube you can see that we are not setting any await strategy, in fact we are using docker-compose format and using docker-machine. And if you run this on your computer and if you have docker-machine installed and running with a dev machine running, the example would run. If you don't use docker-machine but boot2docker standalone, then simply remove machineName property and that's all boot2docker configuration will be used.

Of course I will leave this issue opened to make the static configuration ip aware of dockerServerIp.