All of lore.kernel.org
 help / color / mirror / Atom feed
* Docker network bridge not working on Yocto Hardknott
@ 2022-09-01 15:27 Morgan Baugh
  0 siblings, 0 replies; only message in thread
From: Morgan Baugh @ 2022-09-01 15:27 UTC (permalink / raw)
  To: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]

Hi All,

I have built a Yocto Hardknott image for the i.MX8 according to the 
following Variscite tutorial: Yocto Build Release | Variscite Wiki 
<https://variwiki.com/index.php?title=Yocto_Build_Release&release=mx8-yocto-hardknott-5.10.72_2.2.1-v1.1>

Then, I added Docker by setting the following in local.conf:
IMAGE_INSTALL_append = " docker"
DISTRO_FEATURES_append = " virtualization"

The image builds fine, boots, and runs Docker (which takes a few minutes 
to start), however, the containers fail to connect to the docker0 
bridge. For example, an Nginx container will not emit the expected 
boilerplate HTML via curl:

root@imx8qm-var-som:~# docker run -p 80:80 -d nginx
root@imx8qm-var-som:~# curl localhost
root@imx8qm-var-som:~# curl: (56) Recv failure: Connection reset by peer

This problem can be temporarily overcome by brctl:

root@imx8qm-var-som:~# brctl addif docker0 $(ifconfig | grep veth | cut 
-c 1-11)
root@imx8qm-var-som:~# curl localhost
html stuff that won’t render properly on the forum…

Specifically, Docker is not adding the veth interface to the docker0 
bridge upon container creation/restart. I have tried modifying the Yocto 
build to replace NetworkManager with connman or nothing at all, but this 
doesn’t make a difference. In fact, when NetworkManager is running, 
“nmcli device status” shows docker0 as “connected (externally)”, which, 
to my knowledge, means that something other than NetworkManager is 
responsible for it.

I have repeated the test on a Dunfell version of the Variscite Yocto 
build, as well as a non-Variscite build of Yocto Hardknott for the 
Raspberry Pi 4, and Docker’s network bridge functions properly in both 
cases. However, swapping the meta-virtualization layer (which contains 
Docker itself among other things), meta-openembedded, or the Linux 
kernel from these into the Variscite Hardknott build doesn’t solve the 
problem. I had once considered the possibility that containerd was at 
fault, however, that is part of meta-virtualization, and would have been 
fixed by swapping that layer if it was the problem.

To recap, the problem appears to be specific to Variscite + Yocto 
Hardknott + Docker, and consists of a failure to automatically add the 
veth to docker0. Running the container with host networking does work, 
but is not suitable for my application. Any help would be greatly 
appreciated!

[-- Attachment #2: Type: text/html, Size: 3096 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-01 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 15:27 Docker network bridge not working on Yocto Hardknott Morgan Baugh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.