Build firmware with Docker support - SundanceMultiprocessorTechnology/VCS-1 GitHub Wiki

Docker support

Recompile the kernel (Petalinux) with the following options on:

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> Core Netfilter Configuration -> <*> Netfilter connection tracking support

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> <*> IPv4 connection tracking support (required for NAT)

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> <*> IPv4 NAT

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> <*> IP tables support (required for filtering/masq/NAT)

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> <*> iptables NAT support

Select an option Return Build page to add more support. NOTE Do not forget to return to this page to complete the next steps. or

  1. save and exit

Create the file "docker.cfg"

$ nano project-spec/meta-user/recipes-kernel/linux/linux-xlnx/docker.cfg

and copy the following inside:

CONFIG_NAMESPACES=y
CONFIG_NET_NS=y
CONFIG_PID_NS=y
CONFIG_IPC_NS=y
CONFIG_UTS_NS=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
CONFIG_CPUSETS=y
CONFIG_MEMCG=y
CONFIG_VETH=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_NETFILTER_XT_MATCH_IPVS=y
CONFIG_IP_NF_NAT=y
 
CONFIG_USER_NS=y
CONFIG_SECCOMP=y
CONFIG_CGROUP_PIDS=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_BLK_CGROUP=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_IP_NF_TARGET_REDIRECT=y
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_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_VXLAN=y
CONFIG_INET_ESP=y
CONFIG_IPVLAN=y
CONFIG_MACVLAN=y
CONFIG_DUMMY=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_NAT_TFTP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_AUFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_THIN_PROVISIONING=y
CONFIG_OVERLAY_FS=y
 
CONFIG_MD=y
CONFIG_NET_SCHED=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_BRIDGE=m
 
# CONFIG_EXT2_FS is not set
CONFIG_EXT4_USE_FOR_EXT2=y

Edit the file linux-xlnx%.bbappend_ add the file references ( file://docker.cfg):

$ nano project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
SRC_URI += "file://user_<date>.cfg \
            file://0001-spi-mod.patch"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

NOTE Don't change the user_<date>.cfg and other configurations (e.g. user_2018-08-29-12-34-00.cfg) because it was autogenerated

Create the file "docker-systemd-zcu102-zynqmp.conf"

$ mkdir -p project-spec/meta-user/conf/machine
$ nano project-spec/meta-user/conf/machine/docker-systemd-zcu102-zynqmp.conf

and copy the following inside:

# Inherit all the properties from the zcu102-zynqmp machine
require conf/machine/zcu102-zynqmp.conf
 
# Reuse the fdt for the zcu102 bsp
YAML_DT_BOARD_FLAGS_pn-device-tree = "{BOARD zcu102-rev1.0}"
 
# Downgrade the loglevel to reduce console chatter and disable audit
KERNEL_BOOTARGS_append_pn-u-boot-zynq-uenv = " loglevel=6 audit=0"
 
# Include docker and docker-contrib in the image
IMAGE_INSTALL_append = " docker docker-contrib"
 
# Comment these out to use sysvinit
DISTRO = "petalinux-systemd"
IMAGE_INSTALL_append = " connman"

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> <*> MASQUERADE target support

Networking Support -> Networking Options -> Network Packet filtering framework (Netfilter) -> Core Netfilter Configuration -> {*} ipv4/IPV6 redirect support

Return Build page

⚠️ **GitHub.com Fallback** ⚠️