Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Can not link service or container in compose mode #249

Open
exotfboy opened this issue Nov 23, 2018 · 3 comments
Open

Can not link service or container in compose mode #249

exotfboy opened this issue Nov 23, 2018 · 3 comments

Comments

@exotfboy
Copy link

docker-compose.yaml:

version: "3"
services:
  app:
      image: xxx
  proxy:
      image: dockercloud/haproxy
      links:
        - app
      ports:
        - 81:80
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock

After run docker-compose up --scale app=2 , I got logs like this:

proxy_1  |...07:13: INFO:haproxy:Haproxy is running by docker-compose, loading HAProxy definition through docker api
proxy_1  |...07:13: INFO:haproxy:dockercloud/haproxy PID: 8
proxy_1  |...07:13: INFO:haproxy:=> Add task: Initial start - Compose Mode
proxy_1  |...07:13: INFO:haproxy:=> Executing task: Initial start - Compose Mode
proxy_1  |...07:13: INFO:haproxy:==========BEGIN==========
proxy_1  |...07:13: INFO:haproxy:Linked service: 
proxy_1  |...07:13: INFO:haproxy:Linked container: 

Seems like that dockercloud-haproxy can not find and link any service.

And when I run wget http://localhost:81, I got the error like this:

Connecting to localhost (localhost)|127.0.0.1|:81... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.

What's going on?

My docker version:18.09, and docker compose version: 1.23.1

@db260179
Copy link

This is an easy fix, use the docker-compose 1.23.2, they have reverted that change so container names are now back to _1 instead of random generated.

@db260179
Copy link

@exotfboy
Copy link
Author

Thanks, I will have a try.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants