mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Fix Docker API compatibility with network alias (#17167)
* Add BaseHostsFile to container configuration * Do not copy /etc/hosts file from host when creating a container using Docker API Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
This commit is contained in:
@ -2373,6 +2373,19 @@ func WithGroupEntry(groupEntry string) CtrCreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithBaseHostsFile sets the option to copy /etc/hosts file.
|
||||
func WithBaseHostsFile(baseHostsFile string) CtrCreateOption {
|
||||
return func(ctr *Container) error {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
|
||||
ctr.config.BaseHostsFile = baseHostsFile
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithMountAllDevices sets the option to mount all of a privileged container's
|
||||
// host devices
|
||||
func WithMountAllDevices() CtrCreateOption {
|
||||
|
Reference in New Issue
Block a user