Documentation ¶
Overview ¶
Package net provides options to configure new Docker (custom) networks.
Subpackages provide further driver-specific options:
- github.com/thediveo/morbyd/net/bridge for bridge-related options.
- github.com/thediveo/morbyd/net/macvlan for MACVLAN-related options.
- github.com/thediveo/morbyd/net/ipvlan for IPVLAN-related options.
Usage ¶
To create a new internal custom Docker network, including IPAM pool configuration and bridge-specific configuration:
sess.CreateNetwork(ctx, "my-custom-notwork", net.WithInternal(), bridge.WithBridgeName("brrr-42"), net.WithIPAM(ipam.WithPool("0.0.1.0/24", ipam.WithRange("0.0.1.16/28"))), )
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
Opt is a configuration option when creating a custom Docker network using github.com/thediveo/morbyd.Session.NewNetwork.
func WithDriver ¶
WithDriver specifies the network driver (plugin) to use when creating a new Docker network. If left unspecified, it automatically defaults to Docker's “bridge” driver.
func WithIPAM ¶
WithIPAM specifies the particular IPAM driver configuration to use for allocating IP addresses to containers getting attached to this network. See also ipam.Driver.
func WithInternal ¶
func WithInternal() Opt
WithInternal sets the Docker network to be created as “internal”.
func WithLabels ¶
WithLabels adds multiple key-value labels to Docker network.
func WithOption ¶
WithOption adds a driver option in “KEY=VALUE” format.
type Options ¶
type Options types.NetworkCreate
Options represents the configuration options when creating a custom Docker network, including ipam configuration options.
Directories ¶
Path | Synopsis |
---|---|
Package bridge provides Docker “bridge”-driver specific network configuration options.
|
Package bridge provides Docker “bridge”-driver specific network configuration options. |
Package ipvlan provides Docker “ipvlan”-driver specific network configuration options.
|
Package ipvlan provides Docker “ipvlan”-driver specific network configuration options. |
Package macvlan provides Docker “macvlan”-driver specific network configuration options.
|
Package macvlan provides Docker “macvlan”-driver specific network configuration options. |