Documentation ¶
Overview ¶
Package dockerx contains utilities for working with docker.
Index ¶
- func ContainerPortToHostPort(ctx context.Context, cli client.APIClient, containerID string, ...) (int, error)
- func MakeSystemAssignedPortMap(ports ...nat.Port) nat.PortMap
- func MustMakeNATPort(protocol, portRange string) nat.Port
- func StreamContainerLogs(ctx context.Context, cli client.APIClient, containerID string, log Logger, ...) (io.Closer, error)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerPortToHostPort ¶
func ContainerPortToHostPort( ctx context.Context, cli client.APIClient, containerID string, containerPort nat.Port, ) (int, error)
ContainerPortToHostPort finds the host port to which the given container port has been bound. Useful when starting test containers and allowing them to choose their own host port.
func MakeSystemAssignedPortMap ¶
MakeSystemAssignedPortMap creates a port map for the given list of nat Ports, using system assigned ports for the host side of the port binding.
func MustMakeNATPort ¶
MustMakeNATPort creates a new nat.Port, panicking rather than returning an error if the port is malformed. Useful for constants and tests.
Types ¶
Click to show internal directories.
Click to hide internal directories.