docker-archive / dockercloud-haproxy

HAproxy image that autoreconfigures itself when used in Docker Cloud
https://cloud.docker.com/
651 stars 187 forks source link

imcompatible with docker compose 1.23 #248

Open DeoLeung opened 5 years ago

DeoLeung commented 5 years ago

seems the container naming schema changed, which may be the cause that it can't find the containers

DeoLeung commented 5 years ago

I roll compose back to 1.22.0 and it works

rubenfonseca commented 5 years ago

Took me a while to figure out why it wasn't working. I can confirm the new naming schema breaks the image.

jorihardman commented 5 years ago

A workaround is to use container_name to change the name of your linked container back to what haproxy expects.

Example from my compose file:

services:
  rails:
    container_name: rails_server_rails_1
   ...

  haproxy:
    links:
      - rails
    ...

That fixed it for me in 1.23.1

cnadeau commented 5 years ago

Thanks @jorihardman 🎉

one thing I had to figure out. You need to have the env var LINK_MODE:'new' for that workaround to work

the new parser handles the container_name

Introduced here (I know, a while back)

db260179 commented 5 years ago

https://github.com/docker/compose/releases - 1.23.2 has reverted back to _1 names