code: func adaptSharedNamespaceContainer(daemon containerGetter, hostConfig *containertypes.HostConfig) {
  	containerPrefix := "container:"
  	if hostConfig.PidMode.IsContainer() {
  		pidContainer := hostConfig.PidMode.Container()
  		// if there is any error returned here, we just ignore it and leave it to be
  		// handled in the following logic
  		if c, err := daemon.GetContainer(pidContainer); err == nil {
  			hostConfig.PidMode = containertypes.PidMode(containerPrefix + c.ID)
  		}
  	}
  	if hostConfig.IpcMode.IsContainer() {
  		ipcContainer := hostConfig.IpcMode.Container()
  		if c, err := daemon.GetContainer(ipcContainer); err == nil {
  			hostConfig.IpcMode = containertypes.IpcMode(containerPrefix + c.ID)
  		}
  	}
  	if hostConfig.NetworkMode.IsContainer() {
  		netContainer := hostConfig.NetworkMode.ConnectedContainer()
  		if c, err := daemon.GetContainer(netContainer); err == nil {
  			hostConfig.NetworkMode = containertypes.NetworkMode(containerPrefix + c.ID)
  		}
  	}
  }
docs: // adaptSharedNamespaceContainer replaces container name with its ID in hostConfig.
  // To be more precisely, it modifies `container:name` to `container:ID` of PidMode, IpcMode
  // and NetworkMode.
  //
  // When a container shares its namespace with another container, use ID can keep the namespace
  // sharing connection between the two containers even the another container is renamed.