From ee029334553c87cedb111f93f466e41dee967409 Mon Sep 17 00:00:00 2001
From: Thomas Juerges <thomas.juerges@skao.int>
Date: Mon, 14 Feb 2022 20:35:20 +0000
Subject: [PATCH] Add support for DOCKER_GID on macOS

---
 docker-compose/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/docker-compose/Makefile b/docker-compose/Makefile
index 6c6e3c888..5a667713e 100644
--- a/docker-compose/Makefile
+++ b/docker-compose/Makefile
@@ -77,12 +77,14 @@ else
     UNAME_S := $(shell uname -s)
 
     ifeq ($(UNAME_S),Linux)
+        DOCKER_GID ?= $(shell getent group docker | cut -d: -f 3)
         DISPLAY ?= :0.0
         XAUTHORITY_MOUNT := /tmp/.X11-unix:/tmp/.X11-unix
         XAUTHORITY ?= /hosthome/.Xauthority
         # /bin/sh (=dash) does not evaluate 'docker network' conditionals correctly
         SHELL := /bin/bash
     else ifeq ($(UNAME_S),Darwin)
+        DOCKER_GID ?= $(shell id -g)
         IF_INTERFACE := $(shell scutil --nwi | grep 'Network interfaces:' | cut -d' ' -f3)
         IP_ADDRESS := $(shell scutil --nwi | grep 'address' | cut -d':' -f2 | tr -d ' ' | head -n1)
         DISPLAY := $(IP_ADDRESS):0
@@ -126,7 +128,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
     CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \
     COMPOSE_IGNORE_ORPHANS=true \
     CONTAINER_EXECUTION_UID=$(shell id -u) \
-    DOCKER_GID=$(shell getent group docker | cut -d: -f 3)
+    DOCKER_GID=$(DOCKER_GID)
 
 
 .PHONY: up down minimal start stop restart build build-nocache status clean pull help
-- 
GitLab