From a3e93e7e0f5e205ff9111c63715365c94e268c5f Mon Sep 17 00:00:00 2001
From: Thomas Juerges <203795-tjuerges@users.noreply.gitlab.com>
Date: Wed, 26 May 2021 10:27:40 +0200
Subject: [PATCH] L2SS-227:  Make tangonet the default for Docker

---
 docker-compose/Makefile | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/docker-compose/Makefile b/docker-compose/Makefile
index 1b7983ed1..87101b3e3 100644
--- a/docker-compose/Makefile
+++ b/docker-compose/Makefile
@@ -8,6 +8,11 @@ COMPOSE_FILE_ARGS := --env-file $(DOCKER_COMPOSE_ENV_FILE) $(foreach yml,$(COMPO
 
 ATTACH_COMPOSE_FILE_ARGS := $(foreach yml,$(filter-out tango.yml,$(COMPOSE_FILES)),-f $(yml))
 
+# The default Docker network mode is tangonet.  The "host" network
+# mode will make the tangodb and archiverdb ports clash,
+# But we allow to overwrite it.
+NETWORK_MODE ?= tangonet
+
 # If the first make argument is "start" or "stop"...
 ifeq (start,$(firstword $(MAKECMDGOALS)))
     SERVICE_TARGET = true
@@ -52,7 +57,6 @@ else
 
     ifeq ($(UNAME_S),Linux)
         DISPLAY ?= :0.0
-        NETWORK_MODE ?= host
         XAUTHORITY_MOUNT := /tmp/.X11-unix:/tmp/.X11-unix
         XAUTHORITY ?= /hosthome/.Xauthority
         # /bin/sh (=dash) does not evaluate 'docker network' conditionals correctly
@@ -64,12 +68,6 @@ else
         # Make sure that Darwin, especially from macOS Catalina on,
         # allows X access from our Docker containers.
         ADD_TO_XHOST := $(shell xhost +$(IP_ADDRESS))
-        # network_mode = host doesn't work on MacOS, so fix to the internal network
-        ifeq ($(NETWORK_MODE),)
-            NETWORK_MODE := tangonet
-        else
-            NETWORK_MODE := $(NETWORK_MODE)
-        endif
         XAUTHORITY_MOUNT := $(HOME)/.Xauthority:/hosthome/.Xauthority:ro
         XAUTHORITY := /hosthome/.Xauthority
     endif
-- 
GitLab