From 477c825a49a0226a494ea06568c7682b4d2292c3 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Mon, 17 May 2021 15:24:53 +0200
Subject: [PATCH] L2SS-217: Run JIVE container on host network, instead of the
 custom NETWORK_MODE, to allow it to connect to DISPLAY.

---
 docker-compose/jive.yml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/docker-compose/jive.yml b/docker-compose/jive.yml
index 1e8561d40..5148d1d15 100644
--- a/docker-compose/jive.yml
+++ b/docker-compose/jive.yml
@@ -2,6 +2,12 @@
 # Docker compose file that launches Jive, sending output to a remote X11
 # display.
 #
+# This container will always run on the same network as the host,
+# to make sure the DISPLAY variable can be used verbatim. For the 
+# same reason, TANGO_HOST is hardcoded to be at localhost:10000:
+# the docker network offering our tangodb also exposes it on port 10000
+# on the host.
+#
 # Defines:
 #   - jive: container running Jive
 #
@@ -14,7 +20,7 @@ services:
   jive:
     image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/tango-java:latest
     container_name: ${CONTAINER_NAME_PREFIX}jive
-    network_mode: ${NETWORK_MODE}
+    network_mode: host
     volumes:
       - ${XAUTHORITY_MOUNT}
       - ${TANGO_SKA_CONTAINER_MOUNT}
@@ -23,10 +29,10 @@ services:
     environment:
       - XAUTHORITY=${XAUTHORITY}
       - DISPLAY=${DISPLAY}
-      - TANGO_HOST=${TANGO_HOST}
+      - TANGO_HOST=localhost:10000
     entrypoint:
       - /usr/local/bin/wait-for-it.sh
-      - ${TANGO_HOST}
+      - localhost:10000
       - --timeout=30
       - --strict
       - --
-- 
GitLab