Skip to content

Environment variables for published ports changed when using --link #9900

@jyrkiput

Description

@jyrkiput

I have multiple ports published from command line, ie.

docker run --name backend -p 7101:7101 -p 7102:7102 -p 7103:7103 ....
docker run --name frontedn --link backend:backend ...

There used to be environment variable available for each port, ie.

BACKEND_PORT_7101_TCP_PORT=7101

But now there's only

BACKEND_PORT_7101_TCP_PORT_END=7103
BACKEND_PORT_7101_TCP_PORT_START=7101

I think that fd774a8 changed the behaviour, and it requires at least three ports to be defined

This can be seen with

docker run -d --name backend -p 7101:7101 -p 7102:7102 -p 7103:7103 busybox /bin/sh -c "while true; do sleep 5; done"

and then

docker run -t -i --rm --name frontend --link backend:backend busybox /bin/sh -c set

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions