[OpenWrt-Devel] running docker on openwrt?

Daniel Golle daniel at makrotopia.org
Sun Sep 30 11:18:29 EDT 2018


On Sun, Sep 30, 2018 at 04:52:04PM +0200, Torbjorn Jansson wrote:
> On 2018-09-30 16:21, Daniel Golle wrote:
> > On Sun, Sep 30, 2018 at 02:18:54PM +0200, Torbjorn Jansson wrote:
> > > On 2018-09-30 13:59, Daniel Golle wrote:
> > > > On Sun, Sep 30, 2018 at 12:21:12PM +0200, Torbjorn Jansson wrote:
> > > > > Hello.
> > > > > 
> > > > > a question, is it possible to run docker on openwrt?
> > > > > reason for asking is that i got a raspberrypi running openwrt and it got
> > > > > plenty of storage space and is mostly sitting idle so if i can run docker on
> > > > > it i might be able to consolidate some of the other pis i have for various
> > > > > purposes.
> > > > > 
> > > > > i know you can do it the other way around, running openwrt in a docker
> > > > > instance on a regular computer but can you get docker itself to run under
> > > > > openwrt?
> > > > > 
> > > > > ideas, suggestions?
> > > > 
> > > > Just use LXC, that works well on OpenWrt, I'm using that to run various
> > > > containers running Debian and OpenWrt on top of OpenWrt.
> > > > (but you need to compile it yourself because many of the kernel options
> > > > needed for containers aren't enabled by default)
> > > > 
> > > > Docker didn't attract a lot of interest because it is x86_64 and
> > > > ARM-only, so 80% of OpenWrt-supported devices aren't supported by
> > > > Docker which doesn't provide images for MIPS-like CPUs.
> > > > 
> > > > However, now that Golang has been added to the packages feed we could
> > > > package Docker at least for the platforms supported by it...
> > > > 
> > > 
> > > ok, i see.
> > > i've never tried lxc and i think docker also needs some extra kernel config
> > > options for it to work.
> > > 
> > > i ran the script from:
> > > https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh
> > > on one of my boxes and it complained about:
> > > - CONFIG_NAMESPACES: missing
> > > - CONFIG_NET_NS: missing
> > > - CONFIG_PID_NS: missing
> > > - CONFIG_IPC_NS: missing
> > > - CONFIG_UTS_NS: missing
> > > - CONFIG_CGROUPS: missing
> > > - CONFIG_CGROUP_CPUACCT: missing
> > > - CONFIG_CGROUP_DEVICE: missing
> > > - CONFIG_CGROUP_FREEZER: missing
> > > - CONFIG_CGROUP_SCHED: missing
> > > - CONFIG_CPUSETS: missing
> > > - CONFIG_MEMCG: missing
> > > - CONFIG_NETFILTER_XT_MATCH_IPVS: missing
> > > - CONFIG_POSIX_MQUEUE: missing
> > > 
> > > and then there were a bunch of optional features also missing.
> > 
> > For now the binary distribution doesn't have all those kernel features
> > enabled. You need to compile from source and make sure that
> > CONFIG_LXC_KERNEL_OPTIONS is set, this selects all the kernel options
> > needed to run containers.
> > 
> 
> i see, so a package can modify the kernel options and enable needed features.
> that's quite handy, i didn't know that.
> 
> what i tried to do was to run:
> make kernel_menuconfig CONFIG_TARGET=subtarget
> and then pick the right options myself and then check it with:
> git diff target/linux/
> 
> the diff looked good but the resulting image did not include my extra kernel
> config options for some reason and in don't understand why.

This is not the intended ue of make kernel_menuconfig, that's why...

> i assumed the stuff in target/linux/brcm2708/bcm2710/config-4.9 was going to
> be used as a default template or something but maybe other config options is
> overriding it.

Exactly. The kernel options which are also listed in OpenWrt's .config
always override the target-specific selection made by kernel_menuconfig.

> 
> i'm no expert on the build system (yet?) so any pointers for manually adding
> a few extra config options for testing purposes would be nice.
> 

Just use the regular menuconfig's options mentioned above, all the
cgroups and namespace stuff is listed there as well.
Luka Perkov (@lperkov )and Marko Ratkaj (@ratkaj) can supposedly tell
you more about the LXC integration in OpenWrt.


Cheers


Daniel

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list