VIC Container Fails with "Parsing network alias" when Using --link option
search cancel

VIC Container Fails with "Parsing network alias" when Using --link option

book

Article ID: 340130

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:

Attempting to link a container to already existing container fails with message "Error response from daemon: Server error from portlayer: Parsing network alias".

Example of reproduction below.

# docker -H VCH_IP:2376 --tls run -itd --name WebProxy -p 1111:80 nginx
ae533aed2ff4ba2aaa77f71ebd28035275332d26c6e22b1153422f100b023116
# docker  -H VCH_IP:2376 --tls run -itd --name jumpshell --link WebProxy busybox
ffd7273d094bb038104933f0a749bd14859a8a185dea11315c0ccff260d21b27
docker: Error response from daemon: Server error from portlayer: Parsing network alias WebProxy failed.


Environment

VMware vSphere Integrated Containers 1.x

Cause

The method of using "--link destination_container" is a deprecated docker behavior.

Resolution

In VIC "--link container_name" linking is already configured by default for containers on the same bridge network to connect to each other. Use "docker network ls" and "docker network inspect <network_name>" to see the networks and which containers are attached to the network. Try removing the "--link" option entirely from the create/run command for the container. This will connect to the container services.



Note: docker container hosts have the same behavior for additional docker networks created on the bridge. The out of the box configuration does not auto map on the default bridge network. For this reason, docker will not allow connection by default as --net is not specified to a user created docker network.



Example usage for the  "--link"option usage:

The mapping of an alias to a container is similar looking in that this command also starts with "--link" and supported by VIC. The difference between container linking and alias mapping is where the error is found. This is useful for situations when the container name is different than what the application requires. If the container is "WebProxy", but the application is hardcoded to connect to the name "NickName" then "--link WebProxy:NickName" can be used to make a connection to specific only to the container configured with the link. All other containers would not map NickName. This allows multiple container applications requiring to connect to the name "NickName" to map to a different service per container with a single VCH and bridge network configuration.