linuxkit
linuxkit copied to clipboard
Enable network CAN flag (SocketCAN)
As pointed by docker/for-mac#2580, linuxkit
should enable CAN flag in kernel configuration to allow Docker containers to setup virtual CAN device. The namespace was presented by O. Hartkopp in Linux Kernel 4.12; update docs available on SocketCAN April 2018.
This issue affects both Linux & MacOS.
With [email protected]
update, we can now bridge cap for virtual CAN interface in Docker, instead of relying on hardware devices and tunnelling.
https://github.com/linuxkit/linuxkit/blob/262e6ed3ec9d1d6327df58eda02c8f20f3571b93/kernel/config-4.18.x-x86_64#L1451
This wouldn't be such a hassle, if D4M (Docker 4 Mac) wasn't private. We can't recompile docker-for-mac.iso
properly as seen in linked issue. This needs to be set on linuxkit/linuxkit side.
~reserved
Can't you compile the require kernel modules externally and modprobe them? All the config options in net/can
seem to be tristate
suggesting this should be possible
No. Tested under RedHat Linux and MacOS. Check this comment on why it's not possible. We need explicit allowance from linuxkit side.
@duraki how did you test this? The comment does not say why what i proposed is not possible.
What I suggested was to compile the CAN kernel modules against the headers of the linuxkit kernel used in Docker for Mac and then load the kernel modules from a privileged container. There is some documentation on how to compile external modules in docs/kernels.md
and example code in test/cases/020_kernel/01*_kmod/
.
Unlike the WIFI config (see https://github.com/linuxkit/linuxkit/issues/3092) the CAN kernel config seems to be all kernel modules so this should work. You could even package the compiled kernel modules in a docker image....
Can this be closed?
@brandonros not yet, give me some more time so I can coop with @hartkopp and make a final decision. Thank you. @rn: will provide additional information.
@duraki Were you able to get this to work with D4M ?
Are there any news on support for SocketCan in D4M?