0 Replies Latest reply on May 21, 2014 9:52 AM by Halil-Cem Gürsoy

    Remote Deployment and Docker

    Halil-Cem Gürsoy Newbie

      Hi Folks,


      I try to deploy a ear file into a remote JBoss 7.2.0-FINAL. The deployment has to be done from a Jenkins Build Job running in a Docker (http://Docker.io) container.

      The structure is like this:

      • Server A - Running JBoss
      • Server B - Running Docker (Docker Host)
        • Docker Container (a 'virtual' Jenkins instance running a maven build)


      For the deployment we use the JBoss AS Maven Plugin (goal deploy).


      Then the maven build is executed directly on the server B the deployment runs fine without great problems (ok, the usual maven problems ;-) ).

      If  we run the maven build process inside of the docker container (which runs in Server B) the build fails with an error:

       

      [INFO] <<< jboss-as-maven-plugin:7.5.Final:deploy (default-cli) @ iam-gui <<<

      [INFO]

      [INFO] --- jboss-as-maven-plugin:7.5.Final:deploy (default-cli) @ iam-gui ---

      [INFO] XNIO Version 3.0.7.GA

      [INFO] XNIO NIO Implementation Version 3.0.7.GA

      [INFO] JBoss Remoting version 3.2.12.GA

      [INFO] ------------------------------------------------------------------------

      [INFO] BUILD FAILURE

      [INFO] ------------------------------------------------------------------------

      [INFO] Total time: 48.752 s

      [INFO] Finished at: 2014-05-21T10:00:42+00:00

      [INFO] Final Memory: 26M/438M

      [INFO] ------------------------------------------------------------------------

      [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default-cli) on project iam-gui: Could not execute goal deploy on /home/jenkins/workspace/CommitStage_iam-gui_trunk_deploy/target/iam-gui.war. Reason: I/O Error could not execute operation '{

      [ERROR] "operation" => "read-attribute",

      [ERROR] "address" => [],

      [ERROR] "name" => "launch-type"

      [ERROR] }': java.net.ConnectException: JBAS012144: Could not connect to remote://10.20.30.45:9999. The connection timed out

       

      I've already checked some things:

      • the host binding in JBoss is IMHO OK, the server is started with -b=0.0.0.0 -bmanagement=0.0.0.0
      • the standalone.xml is in most parts the default
      • Firewalls are disabled on Server A and B and doesn't run in the docker container anyway
      • I can open a telnet session from the docker container to the JBoss, but pressing two times 'return' the connection is closed by JBoss (I see the same behavior on server B, too) :

       

      jenkins@26687cbd8e8b:~$ telnet 10.20.30.45 9999

      Trying 10.20.30.45...

      Connected to 10.20.30.45.

      Escape character is '^]'.

      xxx.local

       

      Connection closed by foreign host.

      jenkins@26687cbd8e8b:~$

       

      The network settings of the docker container are as following (excerpt of docker inspect):

       

          "NetworkSettings": {

              "IPAddress": "172.17.0.2",

              "IPPrefixLen": 16,

              "Gateway": "172.17.42.1",

              "Bridge": "docker0",

              "PortMapping": null,

              "Ports": {

                  "22/tcp": [

                      {

                          "HostIp": "0.0.0.0",

                          "HostPort": "10023"

                      }

                  ]

              }

          },

       

      In summary I can connect the JBoss server via telnet out of the docker container, I can deploy from Server B, but not from the container in server B.

       

      Does the JBoss Maven Plugin need a bidirectional communication? Does JBoss opens a connection itself to the maven plugin?

      This would be the only explanation why this does't work out of the container because the container can connect JBoss, but JBoss can't connect the maven process inside of the container (I don't forward any ports except 22 for SSH).

       

      Any suggestions are welcome!

       

      Bye

      Halil