4

I'm running the jboss/drools-workbench and jboss/kie-server images with Docker using:

# Start Drools workbench
docker run -p 18080:8080 -p 8001:8001 -d --name drools-wb jboss/drools-workbench-showcase:latest

# Start the KIE server and link the workbench into it
docker run -d --name kie-server --link drools-wb:kie_wb jboss/kie-server-showcase:latest

After this, I can access the Drools KIE server in the Drools workbench, like so:

enter image description here

I need to run these two containers using docker-compose. However, when converting the two docker run commands into docker-compose services, I can't "see" the Drools KIE in the Drools workbench.

Here's a screenshot of the Drools workbench with no KIE server

enter image description here

Here's my docker-compose.yml:

version: '2'

services:

  drools-wb:
    container_name: drools-wb
    image: jboss/drools-workbench-showcase:latest
    ports:
      - 8001:8001
      - 18080:8080

  kie-server:
    container_name: kie-server
    image: jboss/kie-server-showcase:latest
    links:
      - drools-wb:kie_wb

Notes:

Here's the output of docker-compose ps

   Name             Command          State                             Ports
------------------------------------------------------------------------------------------------------
drools-wb    ./start_drools-wb.sh    Up      0.0.0.0:8001->8001/tcp, 0.0.0.0:18080->8080/tcp, 9990/tcp
kie-server   ./start_kie-server.sh   Up      8080/tcp, 9990/tcp

And here's the output of docker ps -a

CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                     PORTS                                                       NAMES
2b94187cdfb6        jboss/kie-server-showcase:latest         "./start_kie-server.s"   2 seconds ago       Up 1 seconds               8080/tcp, 9990/tcp                                          kie-server
524be42c584c        jboss/drools-workbench-showcase:latest   "./start_drools-wb.sh"   3 seconds ago       Up 2 seconds               0.0.0.0:8001->8001/tcp, 9990/tcp, 0.0.0.0:18080->8080/tcp   drools-wb

My question is: How can I run the jboss/drools-workbench-showcase and jboss/kie-server-showcase images via docker-compose (and see the KIE server in the Drools Workbench)? Is there some concept I'm missing?

zahid
  • 83
  • 1
  • 8

1 Answers1

1

User "jauffrey" commented on Issue 21 in jboss-dockerfiles:

I managed to make those work on v 2+ of compose files. I just compared the container created with the docker run and the one created with compose (using version 3.2), and I figured out this:

39c39
<             "NetworkMode": "default",
---
>             "NetworkMode": "bridge",

So, a workaround is to add network_mode: default in your services.

Nefreo
  • 2,162
  • 1
  • 15
  • 24