Move Daemon.registerMountPoints out of Daemon.setHostConfig

Call registerMountPoints after the rest of the container's
configuration has been set up.

This will make it possible to call an NRI plugin with the
container's config, allowing it to adjust the mounts in that
config, before it's used to find volumes etc.

Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
Rob Murray
2025-11-14 11:28:49 +00:00
parent 48709e502f
commit 22c5c78bfb
3 changed files with 14 additions and 15 deletions

View File

@@ -244,7 +244,7 @@ func (daemon *Daemon) create(ctx context.Context, daemonCfg *config.Config, opts
return nil, err
}
if err := daemon.setHostConfig(ctr, opts.params.HostConfig, opts.params.DefaultReadOnlyNonRecursive); err != nil {
if err := daemon.setHostConfig(ctr, opts.params.HostConfig); err != nil {
return nil, err
}
if err := daemon.registerLinks(ctr); err != nil {
@@ -265,6 +265,9 @@ func (daemon *Daemon) create(ctx context.Context, daemonCfg *config.Config, opts
}
daemon.updateContainerNetworkSettings(ctr, endpointsConfigs)
if err := daemon.registerMountPoints(ctr, opts.params.DefaultReadOnlyNonRecursive); err != nil {
return nil, err
}
if err := daemon.createContainerVolumesOS(ctx, ctr, opts.params.Config, opts.params.HostConfig); err != nil {
return nil, err
}