{"id":16179245,"url":"https://github.com/jonashackt/traefik-docker-windows-server-2016","last_synced_at":"2025-04-01T21:30:57.935Z","repository":{"id":147270283,"uuid":"122951347","full_name":"jonashackt/traefik-docker-windows-server-2016","owner":"jonashackt","description":"Example project showing how to run Traefik in a Windows Docker Container in Windows Server 2016 without the support of bind-mounting named pipes","archived":false,"fork":false,"pushed_at":"2018-02-26T11:09:09.000Z","size":487,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T20:41:59.708Z","etag":null,"topics":["docker","docker-compose","tcp","traefik","windows","windows-server-2016"],"latest_commit_sha":null,"homepage":null,"language":null,"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/jonashackt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-26T10:11:09.000Z","updated_at":"2020-02-14T12:24:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"1dc490fa-8643-46bb-b8e6-c9f349ec5189","html_url":"https://github.com/jonashackt/traefik-docker-windows-server-2016","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/jonashackt%2Ftraefik-docker-windows-server-2016","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Ftraefik-docker-windows-server-2016/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Ftraefik-docker-windows-server-2016/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Ftraefik-docker-windows-server-2016/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonashackt","download_url":"https://codeload.github.com/jonashackt/traefik-docker-windows-server-2016/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246660083,"owners_count":20813338,"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-compose","tcp","traefik","windows","windows-server-2016"],"created_at":"2024-10-10T05:26:17.662Z","updated_at":"2025-04-01T21:30:55.891Z","avatar_url":"https://github.com/jonashackt.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# traefik-docker-windows-server-2016\nExample project showing how to run Traefik in a Windows Docker Container in Windows Server 2016 without the support of bind-mounting named pipes\n\n\n# Problem\n\nIf you want to run Traefik on Windows Server 2016 (not 1709!), you don´t have support for named pipes mounting into your Docker Containers, which is needed for [Traefik](https://traefik.io/) to manage \u0026 proxy all your Docker Containers. So this configuration will only work on Windows Server 1709 ff - because it is [possible there to bind-mount named pipes](https://blog.docker.com/2017/09/docker-windows-server-1709/):\n\n```\nversion: '3.4'\n\nservices:\n  proxy:\n    image: stefanscherer/traefik-windows\n    command: --api --docker --logLevel=WARN --docker.endpoint=npipe:////./pipe/docker_engine\n    networks:\n      - default\n    ports:\n      - \"80:80\"\n      - \"8080:8080\"\n    volumes:\n      - \\\\.\\pipe\\docker_engine:\\\\.\\pipe\\docker_engine\n    restart:\n      always\n\n    logging:\n      driver: \"json-file\"\n      options:\n        max-size: \"500m\"\n        max-file: \"3\"\n\nnetworks:\n  default:\n    external:\n      name: nat\n\n```\n\n# TCP socket to the rescue\n\n\u003e If you need a Windows 2016 Vagrant box to comprehend the steps, just read the paragraph [\"Building your Windows Server 2016 Vagrant box\"](https://blog.codecentric.de/en/2017/04/ansible-docker-windows-containers-spring-boot/)\n\nAn alternative to named-pipes is maybe the access over [the TCP socket](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon#configure-docker-with-configuration-file)?! Let´s try to configure this (thanks to [this gist](https://gist.github.com/alexellis/04d5fcc82ad5e9604bab0b6a0cf92bd9)):\n\n```\nstop-service docker\ndockerd --unregister-service\ndockerd --register-service -H npipe:// -H 0.0.0.0:2375\nstart-service docker\nNew-NetFirewallRule -Name \"Dockerinsecure2375\" -DisplayName \"Docker insecure on TCP/2375\" -Protocol tcp -LocalPort 2375 -Action Allow -Enabled True\n```\n\nThese steps configure:\n\n* the Docker daemon to accept requests on TCP 2375\n* it also allows Requests to that TCP endpoint through the Windows Server firewall \n\nNow let´s configure Traefik to support the TCP socket configuration. First, we need to get the `Ethernet adapter vEthernet (HNS Internal NIC)` IPv4 adress. Therefore type `ipconfig` and extract it (thanks for [the hint, Stefan!](https://github.com/StefanScherer/dockerfiles-windows/blob/master/traefik/docker-compose.yml)). Then edit the following configuration:\n\n```\nversion: '3.4'\n\nservices:\n  proxy:\n    image: stefanscherer/traefik-windows\n    command: --api --docker --logLevel=WARN --docker.endpoint=tcp://YourHNSInternatNICIPv4Adress:2375\n    networks:\n      - default\n    ports:\n      - \"80:80\"\n      - \"8080:8080\"\n    volumes:\n      - .:C:/etc/traefik\n    restart:\n      always\n    logging:\n      driver: \"json-file\"\n      options:\n        max-size: \"500m\"\n        max-file: \"3\"\n\n  whoami1:\n    image: stefanscherer/whoami\n    labels:\n      - \"traefik.backend=whoami\"\n      - \"traefik.frontend.rule=Host:whoami.yourdomain.com\"\n\nnetworks:\n  default:\n    external:\n      name: nat\n```\n\nNow do a `docker-compose up` where your `docker-compose.yml` has been saved. You should get an output like that:\n\n![traefik-and-whoami-running](traefik-and-whoami-running.png)\n\nNow do a `docker inspect nat` on an other Powershell and search for the Docker IP address of Traefik. Paste this IP with 8080 appended into the Browser and you should see the running Traefik webinterface with a `whoami` Docker Compose service registered:\n\n![traefik-webinterface](traefik-webinterface.png)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Ftraefik-docker-windows-server-2016","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonashackt%2Ftraefik-docker-windows-server-2016","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Ftraefik-docker-windows-server-2016/lists"}