For some time I have been thinking about integrating Arquillian with Docker. This is something like moving integration testing to next step.
I have done some PoC, but nothing serious, only to see how we can face the problem, if it would be possible or not and so on.
So the first thing we must take into consideration is if this integration should be in form of a new container support (like Wildfly, TomEE, Tomcat, ...) or as Extension.
For me the first idea was to implement as a new container. It could work pretty well but the problem is:
1) each container can contain inside any application server, so we need to start one container (Docker container) and then execute the deploy of application server within docker using the remote adapter of that application server. Of course another idea is to create one container for each conjunction docker-applicationserver.
To summarize: you can start a container which starts a Wildfly then you need to use Wildfly Remote adapter to deploy the application into that remote container (Which in fact is running inside Docker).
Then it would be great that using the same docker container adapter you can use it with Apache TomEE by only configuring the remote adapter of TomEE.
2) second problem is time. You can spawn a new process (Docker) using Spacelift, but you need to know when the container is up and ready to receive incomings. Starting a Docker is pretty fast, but then you need to add the time of starting the container which can be some seconds as well. Moreover some containers starts the server as daemons (basically those that are implemented like Linux services) and when they finish to start, Docker process remains in background (you know that this happens because the process returns the container id). But other cases for example you can see this behaviour in Docker images with Tomcat, the Docker process never returns, it is on foreground until you kill it.
So after watching this requirements one can think that implementing as Extension may be a better idea because we will have more control over all. But of course I may be wrong.
In this field I think that Arquillian-Spacelift can help us a lot, currently I am working on it because of some missing scenarios I have found during my usage with MongoDB.
Also we must think about next scenario, we must be able to start as many docker containers as required by an application but not necessarily all of them need to have a container installed. For example you may want to start a container with a MongoDB linked to another Docker container with a Wildfly, so you can execute the tests with similar architecture as in production.
As you may see there is a lot of features that we can offer, of course we can start one by one.
I think that the first decision could be if it should be a container adapter or a extension.