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

Can not link service or container in compose mode #249

@exotfboy

Description

@exotfboy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions