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 060887b7e..0f55f34a3 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1506,6 +1506,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. |