2

Edit: I have updated my configuration to reflect Henrik Hoegh's tutorial. I am still running into issues.

I am setting up a local development environment with lots of docker containers running applications. I am using Traefik to manage and locally proxy these containers (each container having a named local URL). Right now my setup is as follows

Traefik.toml

[web]
  address = ":8088"
  [web.statistics]

################################################################
# Docker configuration backend
################################################################
[docker]

endpoint = "unix:///var/run/docker.sock"
domain = "local.io"
watch = true

# Expose containers by default in traefik
exposedbydefault = true

# Use the IP address from the bound port instead of the inner network one. For specific use-case :)
usebindportip = true

# Use Swarm Mode services as data provider
swarmmode = false

Docker-compose.yml file for container

... 
container_name: mcserviceface
labels:
  - "traefik.port=8080"
...

I also have added local.io and mcserviceface.local.io (both pointing to my local machine) to my ect/hosts file.

When I start up the Traefik container and the mcserviceface container, it shows up on the Traefik dashboard, but it does not show the URL as mcserviceface.local.io rather something like http://185.28.0.3:80. I also hit a ERR_CONNECTION_TIMED_OUT when I follow that link.

How do I resolve both of these issues?

Edit: I have made sure that both containers on are on the same docker network via docker network connect .... It does not resolve the issue.

1
  • Do not use docker network connect for this, instead the container should join the network as part of it's creation, preferably inside the compose file. And you'll also want to pass the traefik.docker.network label to specify which network if the container is on more than one.
    – BMitch
    May 7, 2018 at 18:45

1 Answer 1

1

Make sure you connect your traefik instance to the client docker-network (as specified on the bottom of this page):

When running inside a container, Træfik will need network access through:

docker network connect <network> <traefik-container>
1
  • I have updated my question, in particular the issue does not seem to be based on network connection.
    – Btuman
    Jan 30, 2018 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.