I would like to customize how CircleCI runs non-primary containers.
I basically have something like:
- image: selenium/standalone-firefox-debug:latest
In particular, I would like the
selenium/standalone-firefox-debug container to run like:
docker run --add-host test1.local:127.0.0.1 --add-host test2.local:127.0.0.1 --publish 4444:4444 selenium/standalone-firefox-debug
Is there any possibility of customizing the CircleCI job? Is there more documentation on how CircleCI is running the images under-the-hood?
Not on the CircleCI side, no. Also, the networking system in CircleCI is completely customised, and the listener IP addresses are proxied to the localhost of the build container. So, assuming
selenium/standalone-firefox-debug listens on port 4444, it will be proxied to
localhost:4444 on the build container.
If you have two endpoints to test, could you make them available in the build container on different ports? My only wonder is whether
selenium/standalone-firefox-debug can reach them, given that they will be on
localhost addresses (for the build container), but to Firefox, that will refer to its own container.
You may have more luck - and there is a lot more flexibility - if you can drop the secondary containers and run all your requirements in Docker-in-Docker. I’ve got fairly complex set-ups working this way, using PhantomJS.
Unfortunately, the test servers only respond to the custom hostname.
Docker-in-Docker sounds very appealing. Have you noticed any downsides? Caching? Performance? Debugging? Test result reporting?
It sounds a bit more of an overhaul but perhaps it should be the long-term goal for our setup. At the moment, I ended up just building a new image and hosting it in our AWS bucket.
Now I have to figure out how to configure Circle to use
--shm-size 2g to avoid Firefox crashing when running a ton of tests…