diff options
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index 1ffb78da9..da2fc983a 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1487,6 +1487,20 @@ func WithCreateWorkingDir() CtrCreateOption { } } +// WithNetworkAliases sets network aliases for the container. +// Accepts a map of network name to aliases. +func WithNetworkAliases(aliases map[string][]string) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return define.ErrCtrFinalized + } + + ctr.config.NetworkAliases = aliases + + return nil + } +} + // Volume Creation Options // WithVolumeName sets the name of the volume. |