Just like above answer pointed out: we could enable --net=host
, but host network
is not suggested because of multiple known reasons.
In fact this issue happens just because it needs NETLINK
to communicate between kernel & user space, but if not using host network
, host & container will in different netns
, so enabling udev
in the container could make them be in the same netns which then means there's no need to use host network
.
When we ran into this issue, we did next:
# apt-get install udev
# vim /etc/init.d/udev to comment some special settings:
1) Comments next:
#if [ ! -e "/run/udev/" ]; then
# warn_if_interactive
#fi
2) Comments next:
#if ! ps --no-headers --format args ax | egrep -q '^\['; then
# log_warning_msg "udev does not support containers, not started"
# exit 0
#fi
# root@e751e437a8ba:~# service udev start
[ ok ] Starting hotplug events dispatcher: systemd-udevd.
[ ok ] Synthesizing the initial hotplug events (subsystems)...done.
[ ok ] Synthesizing the initial hotplug events (devices)...done.
[ ok ] Waiting for /dev to be fully populated...done.