Justin Thomas
Justin Thomas

Reputation: 5848

Docker: connection reset by peer

Have two running docker containers, Bob and Alice, listening. When running a third process, Jim, who talks to both Bob and Alice. When running this command:

docker run --net home_default --link alice --link bob  -e BOB_URI=http://bob:8080/v3 -e ALICE_URI=http://alice:8080/v1 talker

I see logs on the bob server:

http: panic serving 172.18.0.7:35762: write tcp 172.18.0.5:8080->172.18.0.7:35762: write: connection reset by peer

Am I not setting up the links correctly? Can the servers not talk back to the running process

Upvotes: 0

Views: 4327

Answers (1)

Matt
Matt

Reputation: 74761

You don't need to use links on a custom network as the custom network provides all the functionality that --link does for the default docker0 network.

When using links on a custom network, they perform a slightly different role of setting up and alias.

docker run --net home_default --name bob -d alpine sleep 60
docker run --net home_default alpine ping -c 4 bob
docker run --net home_default --link bob:bob1 alpine ping -c 4 bob1

docker run --net home_default --name alice -d alpine sleep 60
docker run --net home_default alpine ping -c 4 alice
docker run --net home_default --link alice:alica1 alpine ping -c 4 alice1

I would say the issue lies in your service rather than the Docker setup.

Upvotes: 1

Related Questions