Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Fix docker compose for macos #3

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

cristianonicolai
Copy link

No description provided.

@cristianonicolai
Copy link
Author

@krisv can you please check if it works fine on Windows.

@krisv
Copy link
Member

krisv commented Feb 10, 2020

@cristianonicolai traveling this week so at best would only be able to do this next week

@nmirasch
Copy link

@cristianonicolai I checked this on linux and all it's still working fine. I can try it on windows if it's needed

#!/bin/sh

export DOCKER_HOST_IP=$(ip route | grep docker0 | awk '{print $9}')
docker-compose -f ./travel-agency-services.yml rm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cristianonicolai just a minor comment here. For me, it's needed remove the old containers to make it work, I'm guessing it could be a good idea add something like ' yes y | docker-compose -f ./travel-agency-services.yml rm'

@DuncanDoyle
Copy link

Tried on macOS, and it doesn't work. The problem is that:
a) DOCKER_HOST_IP=$(ip route | grep docker0 | awk '{print $9}') does not work on macOS.
b) extra_hosts:
- "host.docker.internal:$DOCKER_HOST_IP"
tries to set "host.docker.internal" to the DOCKER_HOST_IP variable, which is simply empty.

On macOS (and Windows), we don't need to set "host.docker.internal" in the "docker-compose" file, as this DNS name is automatically resolved to the Docker host. I've tried running the "docker-compose" file without the "extra_hosts" setting, and then it works fine.

So, my recommendation would be to create 2 "docker-compose" files, one for Linux in which we resolve the host-ip and set/map the "host.docker.internal" DNS name to the resolved IP in the "extra_hosts" section, and one for macOS/Windows in which we simply rely on the automation resolution of "host.docker.internal".

@cristianonicolai
Copy link
Author

@DuncanDoyle @nmirasch ok, another try, now with two separated compose files.

@DuncanDoyle
Copy link

@cristianonicolai Works fine now on macOS.

Copy link

@DuncanDoyle DuncanDoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine now on macOS. Did a full end-to-end run of the demo, including Kafka, ISPN, Prometheus and Grafana.

@cristianonicolai
Copy link
Author

@nmirasch can you try on Windows too please :)

@@ -0,0 +1,40 @@
version: '2'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cristianonicolai finally I achieve to try this on windows. To make it run I had to change this version to 2.1 having the same issue than is explained here.
docker/compose#4106 (comment)
It's just a comment, maybe is related with the environment where I'm running, but I just installed the last version of docker-desktop for windows.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmirasch thanks, I've updated the version to 2.1.
@DuncanDoyle do you mind checking again if this change doesn't break for you?

@cristianonicolai cristianonicolai merged commit 8184dd8 into kiegroup:master Feb 19, 2020
@cristianonicolai cristianonicolai deleted the docker-compose branch February 19, 2020 02:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants