public class Link extends Object implements Serializable
getName() is made available in the target
container with the aliased name getAlias(). This involves creating an entry in /etc/hosts and some environment
variables in the target container as well as creating a network bridge between both containers.| Constructor and Description |
|---|
Link(String name,
String alias)
Creates a
Link for the container with the given name and an aliased name for use in the target container. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getAlias() |
String |
getName() |
int |
hashCode() |
static Link |
parse(String serialized)
Parses a textual link specification (as used by the Docker CLI) to a
Link. |
String |
toString()
Returns a string representation of this
Link suitable for inclusion in a JSON message. |
public Link(String name, String alias)
Link for the container with the given name and an aliased name for use in the target container.name - the name of the container that you want to link into the target containeralias - the aliased name under which the linked container will be available in the target containerpublic String getName()
public String getAlias()
public static Link parse(String serialized) throws IllegalArgumentException
Link.serialized - the specification, e.g. name:alias or /name1:/name2/aliasLink matching the specificationIllegalArgumentException - if the specification cannot be parsedCopyright © 2017. All Rights Reserved.