Hi,
Let me make sure I understand your use case correctly.
* You have a "maven" container where your source is mounted
* You have a "wildfly" container where WildFly is running
* When you do a "mvn package wildfly:deploy" from your "maven" container, you get a connection refused.
Is that correct?
That seems normal, in your "maven" container, localhost will point to this container and will not reach out to the "wildfly" container.
To make your use case work, there are 2 options afaict:
* use Docker compose[1] (so that the 2 containers are on the same network and the "maven" container can reach out to the "wildfly" container.
* create a network bridge[2] so that the containers are also on the same network
In both case, you will have to use the `wildfly.hostname` system property to connect to the "wildfly" container (instead of the default "localhost"):
mvn package wildfly:deploy -Dwildfly.hostname=<name of the wildfly container>
hope that helps,
Jeff