wildfly configuration is not stored during docker image build with the help of the jboss-cli.sh

I attempted to automatically build a docker image containing a preconfigured wildfly.

The configuration is stored in a simple text-file,which contains JNDI-Names, datasoruces and so on.
This text-file is executed by the jboss-cli.sh over the command line duringthe image build process of docker.

But my problem was, that the build executed, the configuration was executed. ( On a local installed
and running wildfly-instance the configuration was available after stopping wildfly and looking into
the configuration-xml file ).

The used wildfly was from camunda with the preconfigured camunda BPMN engine.

For executing the configuration I used the shell script from here, which worked fine.

The reason, why the configuration was not available in the built docker image is the timing.

The starting wildfly was available, but needed some time to start up the camunda engine. During this
time the configuration was executed and wildfly stopped before camunda was ready.

When waiting some more time for the startup, also the configuration was stored in the docker image.