diff options
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | tools/rdb.py | 7 |
2 files changed, 11 insertions, 7 deletions
@@ -8,7 +8,6 @@ NODE ?= node NPM_BIN ?= npm DEPS_SCRIPT ?= packaging/bundle/deps.py GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) -DOCKER_HOST_IP=`python -c "import socket; print(socket.gethostbyname(socket.gethostname()))"` GCLOUD_AUTH ?= $(shell gcloud auth print-access-token) # NOTE: This defaults the container image version to the branch that's active @@ -953,13 +952,13 @@ docker-isolated: # Docker Compose Development environment docker-compose: docker-auth - DOCKER_HOST_IP=$(DOCKER_HOST_IP) TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose.yml up --no-recreate tower + TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose.yml up --no-recreate tower docker-compose-cluster: docker-auth - DOCKER_HOST_IP=$(DOCKER_HOST_IP) TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose-cluster.yml up + TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose-cluster.yml up docker-compose-test: docker-auth - cd tools && DOCKER_HOST_IP=$(DOCKER_HOST_IP) TAG=$(COMPOSE_TAG) docker-compose run --rm --service-ports tower /bin/bash + cd tools && TAG=$(COMPOSE_TAG) docker-compose run --rm --service-ports tower /bin/bash docker-compose-build: tower-devel-build tower-isolated-build @@ -983,10 +982,10 @@ docker-refresh: docker-clean docker-compose # Docker Development Environment with Elastic Stack Connected docker-compose-elk: docker-auth - DOCKER_HOST_IP=$(DOCKER_HOST_IP) TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose.yml -f tools/elastic/docker-compose.logstash-link.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate + TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose.yml -f tools/elastic/docker-compose.logstash-link.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate docker-compose-cluster-elk: docker-auth - DOCKER_HOST_IP=$(DOCKER_HOST_IP) TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose-cluster.yml -f tools/elastic/docker-compose.logstash-link-cluster.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate + TAG=$(COMPOSE_TAG) docker-compose -f tools/docker-compose-cluster.yml -f tools/elastic/docker-compose.logstash-link-cluster.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate clean-elk: docker stop tools_kibana_1 diff --git a/tools/rdb.py b/tools/rdb.py index 9552c5317e..6670805ea8 100644 --- a/tools/rdb.py +++ b/tools/rdb.py @@ -155,9 +155,14 @@ class CustomPdb(Rdb): return Rdb.displayhook(self, obj) def get_avail_port(self, *args, **kwargs): + try: + socket.gethostbyname('docker.for.mac.localhost') + host = 'docker.for.mac.localhost' + except: + host = os.popen('ip route').read().split(' ')[2] sock, port = Rdb.get_avail_port(self, *args, **kwargs) socket.socket(socket.AF_INET, socket.SOCK_DGRAM).sendto( - str(port), ('dockerhost', 6899) + str(port), (host, 6899) ) return (sock, port) |