mal / docker-for-mac-host-bridge

Host-accessible containers with Docker for Mac
125 stars 23 forks source link

Update for "Docker for Mac" Version 17.06.0-ce-mac19 #4

Closed acrasborn closed 7 years ago

acrasborn commented 7 years ago

Hi @mal,

thank you for your script! It helps me a lot. I'm using it with the following command: $ DOCKER_TAP_NETWORK=docker_default ./install.sh tuntap_20150118.pkg and I get the following error if I try to start my containers with "docker-compose up -d" from the directory "docker": ERROR: Network "docker_default" needs to be recreated - option "com.docker.network.bridge.name" has changed> (Version 17.06.0-ce-mac19) If I remove the option "-o com.docker.network.bridge.name=$netintf" from your script it works perfectly. I'm not aware if this option is relevant for previous versions of "Docker for Mac" but I wanted to share with you my findings.

mal commented 7 years ago

Thanks @acrasborn, glad you were able to get it working again!

That option was (ironically) to provide a safer way of referencing the bridge device inside moby that links to the Docker network. Without it the script falls back to relying on an AFAIK undocumented convention of the bridge being named using the randomly assigned Docker network ID which (thankfully seems unchanged in this release and) is why you're seeing it continue to work when the option is removed.

If there's a new equivelent option in the current driver to provide that internal bridge name, that would be preferable as it means less reliance on that undocumented convention. If you are able to find it and update this PR that'd be excellent.

In terms of moving forward while still supporting older Docker versions, I think the best thing would be to pin the current state of the script for <=17.05 and then continue iterating for >=17.06, which I'll do in the readme once this is merged. 🙂

mal commented 7 years ago

I'm not able to test this for a week or so, but I see no reason this won't work to give 17.06 support. Merging now and will look to see if it can be improved as soon as is feasible.

acrasborn commented 7 years ago

I didn't find another option to provide the current driver that internal bridge name. Since docker evolves quickly, I will first search for another solution when required ;-)