# Building a docker-enabled kernel for the SolidRun

**URL:** https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379
**Category:** NXP LX2160
**Created:** [July 12, 2022, 7:11am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379 "2022-07-12T07:11:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![benoit.donnette](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@benoit.donnette](https://community.solid-run.com/u/benoit.donnette)
#### Post date: [July 12, 2022, 7:11am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/1 "2022-07-12T07:11:26Z")

</div>

The stock kernel config included in the dev environment lacks a few options for docker to run. Here is how you can enable additional options in the kernel, and how I managed to get a dockerd running on my SolidRun machine.

First of all, have a setup where you know you will reliably build a lx2160a firmware. I did it using the [GitHub - SolidRun/lx2160a\_build: Scripts to build basic images for LX2160A COM express type 7 modules](https://github.com/SolidRun/lx2160a_build.git) repo.

Then, the idea I followed (not necessarily the cleaniest way…) was to add the docker related options to the config/lx2k\_additions.config file. I specifically added :  
CONFIG\_BPF=y  
CONFIG\_IRQ\_WORK=y  
CONFIG\_TASKS\_TRACE\_RCU=y  
CONFIG\_NETFILTER\_XT\_MATCH\_IPVS=y  
CONFIG\_NETFILTER\_XT\_MARK=y  
CONFIG\_BPF\_SYSCALL=y  
CONFIG\_CGROUP\_BPF=y  
CONFIG\_IP\_NF\_TARGET\_REDIRECT=m  
CONFIG\_IP\_VS=y  
CONFIG\_IP\_VS\_NFCT=y  
CONFIG\_IP\_VS\_PROTO\_TCP=y  
CONFIG\_IP\_VS\_PROTO\_UDP=y  
CONFIG\_IP\_VS\_RR=y  
CONFIG\_NF\_NAT\_FTP=y  
CONFIG\_NF\_CONNTRACK\_FTP=y  
CONFIG\_NF\_NAT\_TFTP=y  
CONFIG\_NF\_CONNTRACK\_TFTP=y  
CONFIG\_VXLAN=y  
CONFIG\_DUMMY=y  
CONFIG\_IPVLAN=y

And voilà… Build (via docker on PC) the UIbuntu firmware, added docker in it, and dockerd runs.

---

<div class="post-metadata">

### Author: ![heksterb](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@heksterb](https://community.solid-run.com/u/heksterb)
#### Post date: [August 3, 2022, 5:05am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/2 "2022-08-03T05:05:25Z")

</div>

Thanks for the instructions. For some reason, I also needed to add

```
CONFIG_CGROUPS=y
CONFIG_NAMESPACES=y
CONFIG_NET_NS=y

```

for the containers to actually run. Actually, I don’t know if the `CGROUPS` config was necessary (I just threw it in for good measure) but the latter two certainly were.

In addition, while running on Ubuntu 22.04 I also needed to

```
update-alternatives --config iptables

```

to select `iptables-legacy`.

---

<div class="post-metadata">

### Author: ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)
#### Post date: [August 3, 2022, 5:25am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/3 "2022-08-03T05:25:09Z")

</div>

yes CGROUPS are required to run docker containers. That is what provides the security separation.

---

<div class="post-metadata">

### Author: ![hardy](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@hardy](https://community.solid-run.com/u/hardy)
#### Post date: [December 28, 2022, 5:52am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/4 "2022-12-28T05:52:16Z")

</div>

Thanks for your share, I also try build a ROM with docker support.  
but I try to  
1 edit config/lx2k\_additions.config ,and add these new CONFIG\_BPF=y and so on.  
2 docker build -t lx2160a\_build docker  
3 docker run -i -t -v “$PWD”:/work lx2160a\_build -u $(id -u) -g $(id -g)  
but when I finish build and use link check  
[Verify your Linux Kernel for Container Compatibility · Docker Pirates ARMed with explosive stuff (hypriot.com)](https://blog.hypriot.com/post/verify-kernel-container-compatibility/#:~:text=At%20the%20Docker%20open%20source%20project%20you%20can,or%20directly%20from%20a%20kernel.config%20file%20as%20well.)  
I found these config still not build yet, what I miss ?

---

<div class="post-metadata">

### Author: ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)
#### Post date: [December 28, 2022, 11:30am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/5 "2022-12-28T11:30:11Z")

</div>

Did you edit configs/lx2k\_additions.config or configs/linux/lx2k\_additions.config ?

---

<div class="post-metadata">

### Author: ![hardy](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@hardy](https://community.solid-run.com/u/hardy)
#### Post date: [December 29, 2022, 6:33am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/6 "2022-12-29T06:33:36Z")

</div>

Thanks, It works now, I forgot write to eMMC .  
I once think if I use dd write img to sd , when board boot， load kernel from sd first ,then load OS from MMC, then should be OK. but It seems the bootloader it still need read MMC for load kernel in fact.  
can you give me a answer ?

---

<div class="post-metadata">

### Author: ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)
#### Post date: [December 29, 2022, 6:43am UTC](https://community.solid-run.com/t/building-a-docker-enabled-kernel-for-the-solidrun/379/7 "2022-12-29T06:43:05Z")

</div>

u-boot uses the common distro boot scripts for choosing the boot device. In u-boot specifically the boot\_targets variable specifies the order of booting. Additionally the emmc\_dev variable is used also.
