{"id":13587666,"url":"https://github.com/AlmirKadric-Published/docker-tuntap-osx","last_synced_at":"2025-04-07T22:31:28.090Z","repository":{"id":53600208,"uuid":"97719542","full_name":"AlmirKadric-Published/docker-tuntap-osx","owner":"AlmirKadric-Published","description":"A tuntap shim installer for \"Docker for Mac\"","archived":false,"fork":false,"pushed_at":"2021-03-22T03:47:57.000Z","size":22,"stargazers_count":332,"open_issues_count":10,"forks_count":65,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-06T06:41:19.236Z","etag":null,"topics":["docker","docker-for-mac","docker-network","hyperkit","networking","routing","shim","tuntap"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlmirKadric-Published.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-19T13:30:40.000Z","updated_at":"2024-10-30T16:08:40.000Z","dependencies_parsed_at":"2022-09-05T07:11:23.153Z","dependency_job_id":null,"html_url":"https://github.com/AlmirKadric-Published/docker-tuntap-osx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlmirKadric-Published%2Fdocker-tuntap-osx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlmirKadric-Published%2Fdocker-tuntap-osx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlmirKadric-Published%2Fdocker-tuntap-osx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlmirKadric-Published%2Fdocker-tuntap-osx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlmirKadric-Published","download_url":"https://codeload.github.com/AlmirKadric-Published/docker-tuntap-osx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247740810,"owners_count":20988275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-for-mac","docker-network","hyperkit","networking","routing","shim","tuntap"],"created_at":"2024-08-01T15:06:18.616Z","updated_at":"2025-04-07T22:31:27.811Z","avatar_url":"https://github.com/AlmirKadric-Published.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"docker-tuntap-osx\n================\ndocker-tuntap-osx is a tuntap support shim installer for Docker for Mac.\n\nThe Problem\n-----------\nCurrent on Docker for Mac has no support for network routing into the Host Virtual Machine that is created using hyperkit. The reason for this is due to the fact that the network interface options used to create the instance does not create a bridge interface between the Physical Machine and the Host Virtual Machine. To make matters worse, the arguments used to create the Host Virtual Machine is hardcoded into the Docker for Mac binary with no means to configure it.\n\nHow it works\n------------\nThis installer (`docker_tap_install.sh`) will move the original hyperkit binary (`hyperkit.original`) inside the Docker for Mac application and instead places our shim (`./sbin/docker.hyperkit.tuntap.sh`) in its stead. This shim will then inject the additional arguments required to attach a [TunTap](http://tuntaposx.sourceforge.net/) interface into the Host Virtual Machine, essentially creating a bridge interface between the guest and the host (this is essentially what hvint0 is on Docker for Windows).\n\nFrom there the `up` script (`docker_tap_up.sh`) is used to bring the network interface up on both the Physical Machine and the Host Virtual Machine. Unlike the install script, which only needs to be run once, this `up` script must be run for every restart of the Host Virtual Machine.\n\nOnce done the IP address `10.0.75.2` can be used as a network routing gateway to reach any containers within the Host Virtual Machine:\n```\nroute add -net \u003cIP RANGE\u003e -netmask \u003cIP MASK\u003e 10.0.75.2\n```\n\n**Note:** Although as of docker-for-mac version `17.12.0` you do not need the following, for prior versions you will need to setup IP Forwarding in the iptables defintion on the Host Virtual Machine:  \n(This is not done by the helpers as this is not a OSX or tuntap specific issue. You would need to do the same for Docker for Windows, as such it should be handled outside the scope of this project.)\n```\ndocker run --rm --privileged --pid=host debian nsenter -t 1 -m -u -n -i iptables -A FORWARD -i eth1 -j ACCEPT\n```\n\n**Note:** Although not required for docker-for-mac versions greater than `17.12.0`, the above command can be replaced with the following if ever needed and is tested to be working on docker-for-windwos as an alternative. This is in case docker-for-mac changes something in future and this command ends up being a necessity once again.\n```\ndocker run --rm --privileged --pid=host docker4w/nsenter-dockerd /bin/sh -c 'iptables -A FORWARD -i eth1 -j ACCEPT'\n```\n\nDependencies\n------------\n[Docker for Mac](https://www.docker.com/docker-mac)\n\n[TunTap](http://tuntaposx.sourceforge.net/)\n```\nbrew cask install tuntap\n```\n\nHow to install it\n-----------------\nTo install it, run the shim installer script. This will automatically check if the currently installed shim is the correct version and make a backup if necessary:\n```\n./sbin/docker_tap_install.sh\n```\n\nAfter this you will need to bring up the network interfaces every time the docker Host Virtual Machine is restarted:\n```\n./sbin/docker_tap_up.sh\n```\n\nHow to remove it\n----------------\nThe uninstall script will simply revert the installer. Restoring the original and removing the shim:\n```\n./sbin/docker_tap_uninstall.sh\n```\n\nProjects using docker-tuntap-osx\n-----------------------------\n * [helpers-docker](https://github.com/AlmirKadric-Published/helpers-docker-nodejs): Docker Helpers for Node.js\n\nLicense\n-------\n[MIT](https://github.com/AlmirKadric-Published/exTerm-electron/blob/master/LICENSE.md)\n\nReferences \u0026 Credits\n--------------------\n * A big thanks to `michaelhenkel` and [strayerror](https://github.com/mal) on the Docker forums for the inspiration and help to make this package\n * The original thread on the [Docker Forums](https://forums.docker.com/t/support-tap-interface-for-direct-container-access-incl-multi-host/17835)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlmirKadric-Published%2Fdocker-tuntap-osx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlmirKadric-Published%2Fdocker-tuntap-osx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlmirKadric-Published%2Fdocker-tuntap-osx/lists"}