简体   繁体   中英

Running Traefik on Docker Windows Container

I try to run Traefik on docker on Windows native container but I don't find any exemple. I just want to run the Getting Started exemple with whoami. I try many parameters without success. I have two question :

  • how to to pass a configuration file for traefik with an Windows Container ? (binding file don't work on Windows)
  • how to connect to docker host with named pipe ?

Exemple of docker compose I've tried :

version: '3.7'
  services:
    reverse-proxy:
      image: traefik:v1.7.2-nanoserver # The official Traefik docker image
      command: --api --docker --docker.endpoint=npipe:////./pipe/docker_engine # Enables the web UI and tells Træfik to listen to docker
      ports:
        - "80:80"     # The HTTP port
        - "8080:8080" # The Web UI (enabled by --api)
      volumes:
        - source: '\\.\pipe\docker_engine'
          target: '\\.\pipe\docker_engine'
          type: npipe
    whoami:
      image: emilevauge/whoami # A container that exposes an API to show its IP address
      labels:
        - "traefik.frontend.rule=Host:whoami.docker.localhost"

Traefik dashboard work fine on 8080 but no provider found and whoami container not found.

I'm with Windows 10 1803, Docker version 18.06.1-ce, build e68fc7a, docker-compose version 1.22.0, build f46880fe

Note that Traefik work fine if I launch it on my Windows (not in a container).

Thank you for help.

There is a working example of it here . If you would like to run it in swarm, try using docker network create and docker service create instead of docker stack deploy . See my question here for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM