com.github.dockerjava.api.model
Class PortBinding
java.lang.Object
com.github.dockerjava.api.model.PortBinding
public class PortBinding
- extends Object
In a PortBinding
, a network socket on the Docker host, expressed
as a Ports.Binding
, is bound to an ExposedPort
of a container.
A PortBinding
corresponds to the --publish
(-p
) option of the docker run
(and similar)
CLI command for adding port bindings to a container.
Note: This is an abstraction used for creating new port bindings.
It is not to be confused with the abstraction used for querying existing
port bindings from a container configuration in
InspectContainerResponse.NetworkSettings.getPorts()
and HostConfig.getPortBindings()
.
In that context, a Map<ExposedPort, Binding[]>
is used.
PortBinding
public PortBinding(Ports.Binding binding,
ExposedPort exposedPort)
getBinding
public Ports.Binding getBinding()
getExposedPort
public ExposedPort getExposedPort()
parse
public static PortBinding parse(String serialized)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2014. All Rights Reserved.