From 1f51da310165b9295b47a79871bcaa986dcbac0c Mon Sep 17 00:00:00 2001
From: Jakob Olsson <Jakob Olsson>
Date: Thu, 12 Mar 2020 16:35:15 +0100
Subject: [PATCH] docker-ce: add some documentation and misc files

---
 utils/docker-ce/README.md          | 268 +++++++++++++++
 utils/docker-ce/misc/30inteno.conf | 524 +++++++++++++++++++++++++++++
 utils/docker-ce/misc/Dockerfile    |  23 ++
 utils/docker-ce/misc/usb_setup.sh  |  30 ++
 4 files changed, 845 insertions(+)
 create mode 100644 utils/docker-ce/README.md
 create mode 100755 utils/docker-ce/misc/30inteno.conf
 create mode 100644 utils/docker-ce/misc/Dockerfile
 create mode 100755 utils/docker-ce/misc/usb_setup.sh

diff --git a/utils/docker-ce/README.md b/utils/docker-ce/README.md
new file mode 100644
index 0000000000..b451e88793
--- /dev/null
+++ b/utils/docker-ce/README.md
@@ -0,0 +1,268 @@
+# Running Docker on IopsysWrt
+
+To run docker images from iopsysWrt, it is necessary that the kernel is compiled
+with the correct kernel configuration, and flashed onto the board, prior to
+building an image with all the necessary packages. The reason for this being
+that an image compiled with all the necessary packages for docker-ce creates an
+image of roughly 130MB, which is too large to be flashed to a board.
+
+Instead, the binaries of necessary packages should be prepared on a usb memory.
+The usb should be formatted for Ext4, as docker uses large file and directory
+names, which is not supported by FAT32.
+
+The recommended kernel configurations should be set in 30inteno.conf,
+alternatively, replace the 30inteno.conf with the one provided in the docker-ce
+package misc directory.
+
+```
+CONFIG_NAMESPACES
+CONFIG_NET_NS
+CONFIG_PID_NS
+CONFIG_IPC_NS
+CONFIG_UTS_NS
+CONFIG_CGROUPS
+CONFIG_CGROUP_CPUACCT
+CONFIG_CGROUP_DEVICE
+CONFIG_CGROUP_FREEZER
+CONFIG_CGROUP_SCHED
+CONFIG_CPUSETS
+CONFIG_MEMCG
+CONFIG_KEYS
+CONFIG_VETH
+CONFIG_BRIDGE
+CONFIG_BRIDGE_NETFILTER
+CONFIG_NF_NAT_IPV4
+CONFIG_IP_NF_FILTER
+CONFIG_IP_NF_TARGET_MASQUERADE
+CONFIG_NETFILTER_XT_MATCH_ADDRTYPE
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK
+CONFIG_NETFILTER_XT_MATCH_IPVS
+CONFIG_IP_NF_NAT
+CONFIG_NF_NAT
+CONFIG_NF_NAT_NEEDED
+CONFIG_POSIX_MQUEUE
+CONFIG_DEVPTS_MULTIPLE_INSTANCES
+```
+
+The packages recommended for the first compilation are:
+
+```
+bash
+socat
+nsenter
+ethtools
+ca-certificates
+```
+
+For compilation of the actual docker-ce and required binaries the required
+packages are:
+
+```
+runc
+tini
+containerd
+docker-ce
+```
+
+It is a good idea to transfer the .tar.gz file of the first image to the usb
+memory prior to building the second image, containing all the packages, to
+import as the docker image to use inside iopsysWrt.
+
+```
+$ tar -zcvf rootfs.tar.gz build_dir/target-arm_xscale_musl_eabi/root-iopsys-brcm63xx-arm
+$ cp rootfs.tar.gz /media/<USER>/<USB_NAME>/
+```
+
+After the second image is built, it is simplest to transfer the entire rootfs to
+the usb memory:
+
+```
+$ cp -ar build_dir/target-arm_xscale_musl_eabi/root-iopsys-brcm63xx-arm /media/<USER>/<USB_NAME>/
+```
+
+With the rootfs prepared on the usb, it may be plugged into the device flashed
+with the image which kernel configuration was prepared to support docker
+containers. Environment, files may be transferred to
+the filesystem of the flashed image, as they are note excessively large.
+
+```
+# copy necessary environment files
+cp -rf ./root-iopsys-brcm63xx-arm/opt/docker /opt/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/share/docker /usr/share/
+cp -rf ./root-iopsys-brcm63xx-arm/etc/docker /etc/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/docker-ce.control /usr/lib/opkg/info/docker-ce.control
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/docker-ce.list /usr/lib/opkg/info/docker-ce.list
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/tini.list /usr/lib/opkg/info/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/containerd.list /usr/lib/opkg/info/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/status /usr/lib/opkg/status
+cp -rf ./root-iopsys-brcm63xx-arm/etc/group /etc/group
+cp -rf ./root-iopsys-brcm63xx-arm/etc/docker/daemon.json /etc/docker/daemon.json
+cp -rf ./root-iopsys-brcm63xx-arm/etc/init.d/dockerd /etc/init.d/dockerd
+cp -rf ./root-iopsys-brcm63xx-arm/etc/passwd /etc/passwd
+cp -rf ./root-iopsys-brcm63xx-arm/etc/shadow /etc/shadow
+```
+
+The binaries, however, should be hosted on the usb, and soft links
+created from their corresponding paths, as they are too large to be transferred
+to the system. For these to be executable, the usb has to be mounted with
+execute permissions.
+
+```
+# mount with exec permission
+mount -o remount,exec /dev/sda1
+
+# create softlinks to binaries
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/bin/docker* /usr/bin/
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/bin/container* /usr/bin/
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/bin/tini /usr/bin/
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/sbin/runc /usr/sbin/
+```
+
+To preserve resources of the system, create a subdirectory on the usb stick to
+host images and containers used by docker.
+
+```
+# create directory to host images and containers
+mkdir docker
+```
+
+To configure docker to use this subdirectory for its containers and images,
+modify the docker configuration file `/etc/docker/daemon.json`, set the key
+`data-root` to point to the new subdirectory.
+
+```
+# configure docker to use the subdirectory
+echo "{
+    \"data-root\": \"$(pwd)/docker\",
+    \"log-level\": \"warn\"
+}" > /etc/docker/daemon.json
+```
+
+Docker may now be started via its init.d script.
+
+```
+$ ps | grep docker
+12901 root      1128 S    grep docker
+$ /etc/init.d/dockerd start
+$ ps -w | grep docker
+12969 root      823m S    /usr/bin/dockerd
+13032 root      805m S    containerd --config /var/run/docker/containerd/containerd.toml --log-level warn
+14251 root      1128 S    grep docker
+```
+
+To verify that the docker installation is functional, the hello-world example
+may be used:
+
+```
+$ docker run hello-world
+Unable to find image 'hello-world:latest' locally
+latest: Pulling from library/hello-world
+4ee5c797bcd7: Already exists 
+Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
+Status: Downloaded newer image for hello-world:latest
+
+Hello from Docker!
+This message shows that your installation appears to be working correctly.
+
+To generate this message, Docker took the following steps:
+ 1. The Docker client contacted the Docker daemon.
+ 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
+    (arm32v7)
+ 3. The Docker daemon created a new container from that image which runs the
+    executable that produces the output you are currently reading.
+ 4. The Docker daemon streamed that output to the Docker client, which sent it
+    to your terminal.
+
+To try something more ambitious, you can run an Ubuntu container with:
+ $ docker run -it ubuntu bash
+
+Share images, automate workflows, and more with a free Docker ID:
+ https://hub.docker.com/
+
+For more examples and ideas, visit:
+ https://docs.docker.com/get-started/
+```
+
+Next a smaller image such as alpine may be tested in interactive mode:
+
+```
+$ docker run -it alpine sh
+Unable to find image 'alpine:latest' locally
+latest: Pulling from library/alpine
+3a2c5e3c37b2: Already exists
+Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
+Status: Downloaded newer image for alpine:latest
+docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"open /dev/ptmx: no such file or directory\"": unknown.
+ERRO[0007] error waiting for container: context canceled
+```
+
+For whatever reason the container may not find `/dev/ptmx`, or whatever other
+file on the filesystem, this may however be worked around by mounted `/dev`.
+
+```
+$ docker run -v /dev:/
+dev -it alpine /bin/sh
+/ #
+```
+However, generally, the instance crashes fairly quickly without an error
+message.
+
+To import the iopsysWrt image prepared on the usb, first import it to docker:
+
+```
+$ docker import rootfs.tar.gz
+ iopsys:latest
+sha256:e62272b27a45fb1f203e7f4a37af4800bec67946413f1d40f62f649f8d8aeab3
+$ docker images
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
+iopsys              latest              e62272b27a45        About a minute ago   60MB
+```
+
+Then build it using the Dockerfile provided in the IOPSYS docker-ce package:
+
+```
+$ cat Dockerfile
+FROM iopsys:latest
+
+LABEL maintainer="jakob.olsson@iopsys.eu"
+LABEL build="docker build -t iopsys ."
+
+CMD [ "/sbin/init" ]
+$ docker build -t iopsys .
+Sending build context to Docker daemon  1.462GB
+```
+
+With the build finished, the iopsysWrt docker may be started from inside
+iopsysWrt, interactively, however, some issues are encountered and have to
+worked around.
+
+
+```
+$ docker run -it iopsys
+```
+
+The first error encountered is the `no password error`, which can
+be circumvented by starting the container through the uid of root, 0, through
+the `--user` flag.
+
+
+```
+$ docker run --user 0 -it iopsys
+```
+
+This leads to the second error, no `/dev/ptmx`, which is handled the same way as
+for the alpine image, mount `/dev`.
+
+```
+$ docker run --user 0 -v /dev:/dev -it iopsys
+```
+
+Lastly, `/sbin/init` can not be found, which again may be solved through
+mounting `/sbin` with the `-v` flag.
+
+```
+$ docker run --user 0 -v /dev:/dev -v /sbin:/sbin -it iopsys
+```
+
+Even with all these fixes, the iopsysWrt image will not start, likely because of
+resource issues, however, no proper codes can be found.
diff --git a/utils/docker-ce/misc/30inteno.conf b/utils/docker-ce/misc/30inteno.conf
new file mode 100755
index 0000000000..994e700660
--- /dev/null
+++ b/utils/docker-ce/misc/30inteno.conf
@@ -0,0 +1,524 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use FindBin qw($Bin);
+use lib "$Bin/../../PerlLib";
+use BRCM::GenConfig;
+
+# $p will allow us to GET values from the PROFILE
+# $c will allow us to SET (and GET and DRIVER_SETUP) on the config
+# file as we transform it from a template to the final config
+
+# arguments 
+# * profile file
+# * config  file
+my $p    = new BRCM::GenConfig(shift);
+my $chip = $p->get('BRCM_CHIP');
+my $arch = $p->get('PROFILE_ARCH');
+my $c    = new BRCM::GenConfig( shift, Chip => $chip, Profile => $p );
+
+
+if ( $arch =~ /^arm$/ ) {
+
+	# This is for ARM only
+	$c->set('USE_OF',                                     'y' );
+	$c->set('CONFIG_ATAGS',                               'y' );
+	$c->set('BCM_KERNEL_CMDLINE_BOOL',                    'y' );
+	$c->set('BCM_KERNEL_CMDLINE_OVERRIDE',                'y' );
+	$c->unset('CMDLINE_FROM_BOOTLOADER');
+	$c->unset('CONFIG_CMDLINE_EXTEND');
+	$c->set('CONFIG_CMDLINE', '"console=ttyS0,115200 debug irqaffinity=0 coherent_pool=1M cpuidle_sysfs_switch pci=pcie_bus_safe cma=0M rw noinitrd rootwait ubi.mtd=ubi ubi.fm_autoconvert=0 rootfstype=ubifs"' );
+	$c->set('CONFIG_CMDLINE_FORCE',                       'y' );
+	$c->set('BCM_KERNEL_CMDLINE', $p->get('CONFIG_CMDLINE'));
+
+} elsif ( $arch =~ /^mips$/ ) {
+
+	# This is for MIPS only
+
+	# With SDK 5.02L.02 the kernel command line is provided
+	# by device tree. We override that here though since Iopsys
+	# need custom arguments and Broadcom device tree has no
+	# support for custom device tree overlays; thus it would
+	# need to be patched.
+	$c->set( 'CONFIG_CMDLINE_BOOL',     'y' );
+	$c->set( 'CONFIG_CMDLINE_OVERRIDE', 'y');
+	$c->set( 'CONFIG_CMDLINE', '"console=ttyS0,115200 debug irqaffinity=0 cma=0M rw noinitrd rootwait ubi.mtd=ubi ubi.fm_autoconvert=0 rootfstype=ubifs"');
+}
+
+$c->set( 'CONFIG_EVENTFD',				  'y' );
+
+$c->set( 'CONFIG_MTD_BLOCK',                              'y' );
+$c->set( 'CONFIG_MTD_PARTITIONS',                         'y' );
+$c->set( 'CONFIG_MTD_UBI',                                'y' );
+$c->set( 'CONFIG_MTD_UBI_GLUEBI',                         'y' );
+$c->set( 'CONFIG_MTD_UBI_BLOCK',                          'y' );
+$c->set( 'CONFIG_JFFS2_FS',                               'y' );
+$c->set( 'CONFIG_JFFS2_FS_WRITEBUFFER',                   'y' );
+$c->set( 'CONFIG_JFFS2_FS_DEBUG',                         "0" );
+$c->set( 'CONFIG_JFFS2_SUMMARY',                          'y' );
+$c->set( 'CONFIG_UBIFS_FS',                               'y' );
+$c->set( 'CONFIG_UBIFS_FS_ZLIB',                          'y' );
+$c->set( 'CONFIG_MTD_NAND',                               'y' );
+$c->set( 'CONFIG_MTD_NAND_BRCMNAND',                      'y' );
+$c->set( 'CONFIG_MTD_PARTITIONED_MASTER',                 'y' );
+$c->set( 'CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING',  'n' );
+$c->set( 'CONFIG_MTD_UBI_BEB_LIMIT',                      "41" );
+$c->unset('CONFIG_BCM_KF_UBI');
+$c->set( 'CONFIG_BCM_OVERLAYFS_BACKPORTS',                'y');
+$c->set( 'CONFIG_BCM_UBIFS_OVERLAY_BACKPORTS',            'y');
+
+$c->set( 'CONFIG_CRYPTO_HW',                              'y' );
+$c->set( 'CONFIG_HW_RANDOM',                              'y' );
+$c->set( '# CONFIG_CRYPTO_DEV_HIFN_795X is not set',      '' );
+$c->set( 'CONFIG_CRYPTO_LZMA',                            'y' );
+$c->set( 'CONFIG_UBIFS_FS_LZMA',                          'y' );
+$c->set( 'CONFIG_LZMA_COMPRESS',                          'y' );
+$c->set( 'CONFIG_LZMA_DECOMPRESS',                        'y' );
+$c->set( 'CONFIG_JFFS2_COMPRESSION_OPTIONS',              'y' );
+$c->set( 'CONFIG_JFFS2_LZMA',                             'y' );
+$c->set( 'CONFIG_JFFS2_FS_XATTR',                         'y' );
+$c->set( 'CONFIG_JFFS2_SUMMARY',                          'y' );
+$c->set( 'CONFIG_JFFS2_FS_POSIX_ACL',                     'n' );
+$c->set( 'CONFIG_JFFS2_FS_SECURITY',                      'y' );
+$c->set( 'CONFIG_USB_NET_CDC_EEM',                        'm' );
+$c->set( 'CONFIG_USB_NET_CDC_MBIM',                       'm' );
+$c->set( 'CONFIG_USB_NET_CDC_NCM',                        'm' );
+$c->set( 'CONFIG_USB_NET_SMSC75XX',                       'n' );
+$c->set( 'CONFIG_USB_NET_SMSC95XX',                       'n' );
+$c->set( 'CONFIG_USB_NET_CX82310_ETH',                    'n' );
+$c->set( 'CONFIG_USB_NET_KALMIA',                         'm' );
+$c->set( 'CONFIG_USB_NET_QMI_WWAN',                       'm' );
+$c->set( 'CONFIG_USB_NET_INT51X1',                        'n' );
+$c->set( 'CONFIG_USB_SIERRA_NET',                         'n' );
+$c->set( 'CONFIG_USB_VL600',                              'm' );
+$c->set( 'CONFIG_EPOLL',                                  'y' );
+$c->set( 'CONFIG_TUN',                                    'y' );
+$c->set( 'CONFIG_USB_HSO',                                'y' );
+$c->set( 'CONFIG_USB_ACM',                                'y' );
+$c->set( 'CONFIG_USB_USBNET',                             'm' );
+$c->set( 'CONFIG_USB_NET_CDCETHER',                       'm' );
+$c->set( 'CONFIG_USB_SERIAL',                             'y' );
+$c->set( 'CONFIG_USB_SERIAL_CONSOLE',                     'y' );
+$c->set( 'CONFIG_USB_SERIAL_CP210X',                      'y' );
+$c->set( 'CONFIG_USB_SERIAL_FTDI_SIO',                    'y' );
+$c->set( 'CONFIG_USB_SERIAL_PL2303',                      'y' );
+$c->set( 'CONFIG_USB_SERIAL_OPTION',                      'y' );
+$c->set( '# CONFIG_USB_EZUSB is not set',                  '' );
+$c->set( 'CONFIG_USB_SERIAL_GENERIC',                     'y' );
+$c->set( 'CONFIG_FUTEX',                                  'y' );
+
+$c->set( 'CONFIG_I2C',						'y' );
+$c->set( 'CONFIG_I2C_CHARDEV',					'y' );
+$c->set( '# CONFIG_I2C_DEBUG_ALGO is not set',			'' );
+$c->set( '# CONFIG_I2C_DEBUG_BUS is not set',			'' );
+$c->set( '# CONFIG_I2C_DEBUG_CORE is not set',			'' );
+$c->set( 'CONFIG_I2C_ALGOBIT',					'm' );
+$c->set( '# CONFIG_I2C_ALI1535 is not set',			'' );
+$c->set( '# CONFIG_I2C_ALI1563 is not set',			'' );
+$c->set( '# CONFIG_I2C_ALI15X3 is not set',			'' );
+$c->set( '# CONFIG_I2C_AMD756 is not set',			'' );
+$c->set( '# CONFIG_I2C_AMD8111 is not set',			'' );
+$c->set( 'CONFIG_I2C_BOARDINFO',				'y' );
+$c->set( '# CONFIG_I2C_CHARDEV is not set',			'' );
+$c->set( 'CONFIG_I2C_COMPAT',					'y' );
+$c->set( '# CONFIG_I2C_DEBUG_ALGO is not set',			'' );
+$c->set( '# CONFIG_I2C_DEBUG_BUS is not set',			'' );
+$c->set( '# CONFIG_I2C_DEBUG_CORE is not set',			'' );
+$c->set( '# CONFIG_I2C_DESIGNWARE_PCI is not set',		'' );
+$c->set( '# CONFIG_I2C_DIOLAN_U2C is not set',			'' );
+$c->set( '# CONFIG_I2C_EG20T is not set',			'' );
+$c->set( 'CONFIG_I2C_GPIO',					'm' );
+$c->set( 'CONFIG_I2C_GPIO_CUSTOM',				'm' );
+$c->set( 'CONFIG_I2C_HELPER_AUTO',				'y' );
+$c->set( '# CONFIG_I2C_I801 is not set',			'' );
+$c->set( '# CONFIG_I2C_INTEL_MID is not set',			'' );
+$c->set( '# CONFIG_I2C_ISCH is not set',			'' );
+$c->set( '# CONFIG_I2C_MUX is not set',				'' );
+$c->set( '# CONFIG_I2C_NFORCE2 is not set',			'' );
+$c->set( '# CONFIG_I2C_OCORES is not set',			'' );
+$c->set( '# CONFIG_I2C_PARPORT_LIGHT is not set',		'' );
+$c->set( '# CONFIG_I2C_PCA_PLATFORM is not set',		'' );
+$c->set( '# CONFIG_I2C_PIIX4 is not set',			'' );
+$c->set( '# CONFIG_I2C_PXA_PCI is not set',			'' );
+$c->set( '# CONFIG_I2C_SIMTEC is not set',			'' );
+$c->set( '# CONFIG_I2C_SIS5595 is not set',			'' );
+$c->set( '# CONFIG_I2C_SIS630 is not set',			'' );
+$c->set( '# CONFIG_I2C_SIS96X is not set',			'' );
+$c->set( '# CONFIG_I2C_STUB is not set',			'' );
+$c->set( '# CONFIG_I2C_TAOS_EVM is not set',			'' );
+$c->set( '# CONFIG_I2C_TINY_USB is not set',			'' );
+$c->set( '# CONFIG_I2C_VIA is not set',				'' );
+$c->set( '# CONFIG_I2C_VIAPRO is not set',			'' );
+$c->set( '# CONFIG_I2C_XILINX is not set',			'' );
+
+$c->set( '# CONFIG_USB_SERIAL_AIRCABLE is not set',                    '' );
+$c->set( '# CONFIG_USB_SERIAL_ARK3116 is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_BELKIN is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_ARK3116 is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_CH341 is not set',                       '' );
+$c->set( '# CONFIG_USB_SERIAL_WHITEHEAT is not set',                   '' );
+$c->set( '# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set',             '' );
+$c->set( '# CONFIG_USB_SERIAL_CYPRESS_M8 is not set',                  '' );
+$c->set( '# CONFIG_USB_SERIAL_EMPEG is not set',                       '' );
+$c->set( '# CONFIG_USB_SERIAL_FUNSOFT is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_VISOR is not set',                       '' );
+$c->set( '# CONFIG_USB_SERIAL_IPAQ is not set',                        '' );
+$c->set( '# CONFIG_USB_SERIAL_IR is not set',                          '' );
+$c->set( '# CONFIG_USB_SERIAL_EDGEPORT is not set',                    '' );
+$c->set( '# CONFIG_USB_SERIAL_EDGEPORT_TI is not set',                 '' );
+$c->set( '# CONFIG_USB_SERIAL_F81232 is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_GARMIN is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_IPW is not set',                         '' );
+$c->set( '# CONFIG_USB_SERIAL_IUU is not set',                         '' );
+$c->set( '# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set',                 '' );
+$c->set( '# CONFIG_USB_SERIAL_KEYSPAN is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_KLSI is not set',                        '' );
+$c->set( '# CONFIG_USB_SERIAL_KOBIL_SCT is not set',                   '' );
+$c->set( '# CONFIG_USB_SERIAL_MCT_U232 is not set',                    '' );
+$c->set( '# CONFIG_USB_SERIAL_METRO is not set',                       '' );
+$c->set( '# CONFIG_USB_SERIAL_MOS7720 is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_MOS7840 is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_MOTOROLA is not set',                    '' );
+$c->set( '# CONFIG_USB_SERIAL_NAVMAN is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_OTI6858 is not set',                     '' );
+
+$c->set( 'CONFIG_USB_SERIAL_QCAUX',                       'm' );
+$c->set( 'CONFIG_USB_SERIAL_QUALCOMM',                    'm' );
+
+$c->set( '# CONFIG_USB_SERIAL_SPCP8X5 is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_HP4X is not set',                        '' );
+$c->set( '# CONFIG_USB_SERIAL_SAFE is not set',                        '' );
+$c->set( '# CONFIG_USB_SERIAL_SIEMENS_MPI is not set',                 '' );
+$c->set( '# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set',              '' );
+$c->set( '# CONFIG_USB_SERIAL_SYMBOL is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_TI is not set',                          '' );
+$c->set( '# CONFIG_USB_SERIAL_CYBERJACK is not set',                   '' );
+$c->set( '# CONFIG_USB_SERIAL_XIRCOM is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_OMNINET is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_OPTICON is not set',                     '' );
+$c->set( '# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set',              '' );
+$c->set( '# CONFIG_USB_SERIAL_ZIO is not set',                         '' );
+$c->set( '# CONFIG_USB_SERIAL_SSU100 is not set',                      '' );
+$c->set( '# CONFIG_USB_SERIAL_DEBUG is not set',                       '' );
+$c->set( 'CONFIG_OVERLAYFS_FS',                           'y' );
+$c->set( 'CONFIG_OVERLAY_FS',                             'y' );
+$c->set( 'CONFIG_SHMEM',                                  'y' );
+$c->set( 'CONFIG_TMPFS',                                  'y' );
+$c->set( 'CONFIG_TMPFS_XATTR',                            'y' );
+$c->set( 'CONFIG_DEVTMPFS',                               'y' );
+$c->set( 'CONFIG_DEVTMPFS_MOUNT',                         'y' );
+
+$c->set( 'CONFIG_IP_NF_MATCH_RPFILTER',			  	'm' );
+$c->set( 'CONFIG_IP_NF_RAW',			  		'm' );
+$c->set( 'CONFIG_IP_NF_TARGET_REJECT',			  	'm' );
+$c->set( 'CONFIG_IP_SET',			  		'm' );
+$c->set( 'CONFIG_IP_SET_MAX',			  		'256' );
+$c->set( 'CONFIG_IP_SET_BITMAP_IP',			  	'm' );
+$c->set( 'CONFIG_IP_SET_BITMAP_IPMAC',			  	'm' );
+$c->set( 'CONFIG_IP_SET_BITMAP_PORT',			  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_IP',			  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_IPPORT',			  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_IPPORTIP',			  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_IPPORTNET',		  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_NET',			  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_NETPORT',			  	'm' );
+$c->set( 'CONFIG_IP_SET_HASH_NETIFACE',			  	'm' );
+$c->set( 'CONFIG_IP_SET_LIST_SET',			  	'm' );
+$c->set( 'CONFIG_IP6_NF_MATCH_FRAG',			  	'm' );
+$c->set( 'CONFIG_IP6_NF_MATCH_RPFILTER',			'm' );
+$c->set( 'CONFIG_IP6_NF_TARGET_REJECT',			  	'm' );
+$c->set( 'CONFIG_NETFILTER_XT_TARGET_CT',			'm' );
+$c->set( 'CONFIG_NF_CONNTRACK_ZONES',				'y' );
+$c->set( 'CONFIG_NETFILTER_XT_TARGET_NOTRACK',			'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_COMMENT',		  	'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_CONNMARK',                 	'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_LENGTH',			'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_OWNER',		  	'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_RECENT',		  	'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_STATISTIC',			'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_STRING',			'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_TIME',			'm' );
+$c->set( 'CONFIG_NETFILTER_XT_SET',				'm' );
+$c->set( 'CONFIG_NETFILTER_XT_MATCH_ID',			'm' );
+$c->set( 'CONFIG_NET_SCH_HFSC',					'y' );
+$c->set( 'CONFIG_BRIDGE_IGMP_SNOOPING',				'y' );
+
+
+$c->set( 'CONFIG_BLK_DEV_SR',					'y' );
+$c->set( 'CONFIG_BLK_DEV_SR_VENDOR',				'y' );
+
+$c->set( 'CONFIG_ISO9660_FS',					'y' );
+$c->set( 'CONFIG_JOLIET',					'y' );
+$c->set( 'CONFIG_ZISOFS',					'y' );
+$c->set( 'CONFIG_UDF_FS',					'y' );
+$c->set( 'CONFIG_UDF_NLS',					'y' );
+$c->set( 'CONFIG_KEYS',						'y' );
+$c->set( '# CONFIG_ENCRYPTED_KEYS is not set',			'' );
+$c->set( '# CONFIG_KEYS_DEBUG_PROC_KEYS is not set',		'' );
+$c->set( '# CONFIG_SECURITY_DMESG_RESTRICT is not set',		'' );
+$c->set( '# CONFIG_SECURITY is not set',			'' );
+$c->set( '# CONFIG_SECURITYFS is not set',			'' );
+
+$c->set( 'CONFIG_CIFS',					  	'm' );
+$c->set( '# CONFIG_CIFS_STATS is not set',			'' );
+$c->set( '# CONFIG_CIFS_WEAK_PW_HASH is not set',		'' );
+$c->set( '# CONFIG_CIFS_XATTR is not set',			'' );
+$c->set( '# CONFIG_CIFS_DEBUG2 is not set',			'' );
+$c->set( 'CONFIG_DNS_RESOLVER',					'm' );
+$c->set( '# CONFIG_ECRYPT_FS is not set',			'' );
+$c->set( 'CONFIG_CIFS_UPCALL',					'y' );
+$c->set( 'CONFIG_CIFS_DFS_UPCALL',				'y' );
+
+$c->set( 'CONFIG_L2TP',						'y' );
+$c->set( 'CONFIG_PPP',						'y' );
+$c->set( 'CONFIG_ACCEL_PPTP',					'y' );
+$c->set( 'CONFIG_PPP_MPPE',					'y' );
+$c->set( 'CONFIG_PPP_MULTILINK',				'y' );
+$c->set( 'CONFIG_PPPOATM',					'y' );
+$c->set( 'CONFIG_PPPOE',					'y' );
+$c->set( 'CONFIG_TIMERFD',					'y' );
+$c->set( 'CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB',			'y' );
+$c->set( 'CONFIG_DEBUG_GPIO',					'y' );
+$c->set( 'CONFIG_GPIOLIB',					'y' );
+$c->set( '# CONFIG_LEDS_GPIO is not set',			'' );
+$c->set( '# CONFIG_LEDS_LT3593 is not set',			'' );
+$c->set( '# CONFIG_GPIO_74X164 is not set',			'' );
+$c->set( '# CONFIG_GPIO_BT8XX is not set',			'' );
+$c->set( '# CONFIG_GPIO_GENERIC_PLATFORM is not set',		'' );
+$c->set( '# CONFIG_GPIO_MAX7301 is not set',			'' );
+$c->set( '# CONFIG_GPIO_MC33880 is not set',			'' );
+$c->set( '# CONFIG_GPIO_MCP23S08 is not set',			'' );
+$c->set( '# CONFIG_GPIO_ML_IOH is not set',			'' );
+$c->set( '# CONFIG_GPIO_RDC321X is not set',			'' );
+$c->set( 'CONFIG_GPIO_SYSFS',					'y' );
+$c->set( '# CONFIG_GPIO_VX855 is not set',			'' );
+$c->set( '# CONFIG_MFD_TIMBERDALE is not set',			'' );
+$c->set( '# CONFIG_MFD_TPS65912_SPI is not set',		'' );
+$c->set( '# CONFIG_MTD_GPIO_ADDR is not set',			'' );
+$c->set( '# CONFIG_SERIAL_IFX6X60 is not set',			'' );
+$c->set( '# CONFIG_SPI_GPIO is not set',			'' );
+$c->set( '# CONFIG_SPI_OC_TINY is not set',			'' );
+$c->set( '# CONFIG_TI_ST is not set',				'' );
+$c->set( '# CONFIG_USB_GPIO_VBUS is not set',			'' );
+$c->set( '# CONFIG_ALTERA_STAPL is not set',			'' );
+$c->set( '# CONFIG_APDS9802ALS is not set',			'' );
+$c->set( '# CONFIG_BMP085 is not set',				'' );
+$c->set( '# CONFIG_DS1682 is not set',				'' );
+$c->set( '# CONFIG_EEPROM_AT24 is not set',			'' );
+$c->set( '# CONFIG_EEPROM_LEGACY is not set',			'' );
+$c->set( '# CONFIG_EEPROM_MAX6875 is not set',			'' );
+$c->set( '# CONFIG_GPIO_ADP5588 is not set',			'' );
+$c->set( '# CONFIG_GPIO_MAX7300 is not set',			'' );
+$c->set( '# CONFIG_GPIO_MAX732X is not set',			'' );
+$c->set( '# CONFIG_GPIO_PCA953X is not set',			'' );
+$c->set( '# CONFIG_GPIO_PCF857X is not set',			'' );
+$c->set( '# CONFIG_HMC6352 is not set',				'' );
+$c->set( '# CONFIG_ICS932S401 is not set',			'' );
+$c->set( '# CONFIG_ISL29003 is not set',			'' );
+$c->set( '# CONFIG_ISL29020 is not set',			'' );
+$c->set( '# CONFIG_MFD_PCF50633 is not set',			'' );
+$c->set( '# CONFIG_MFD_TPS65217 is not set',			'' );
+$c->set( '# CONFIG_MFD_WL1273_CORE is not set',			'' );
+$c->set( '# CONFIG_MFD_WM8400 is not set',			'' );
+$c->set( '# CONFIG_SENSORS_APDS990X is not set',		'' );
+$c->set( '# CONFIG_SENSORS_BH1770 is not set',			'' );
+$c->set( '# CONFIG_SENSORS_BH1780 is not set',			'' );
+$c->set( '# CONFIG_SENSORS_TSL2550 is not set',			'' );
+$c->set( '# CONFIG_TPS6105X is not set',			'' );
+$c->set( '# CONFIG_TPS65010 is not set',			'' );
+$c->set( '# CONFIG_TPS6507X is not set',			'' );
+$c->set( '# CONFIG_USB_SWITCH_FSA9480 is not set',		'' );
+$c->set( '# CONFIG_GPIO_SX150X is not set',			'' );
+$c->set( '# CONFIG_MFD_ASIC3 is not set',			'' );
+$c->set( '# CONFIG_MFD_TC6393XB is not set',			'' );
+$c->set( '# CONFIG_MFD_TPS6586X is not set',			'' );
+$c->set( '# CONFIG_MFD_TPS65910 is not set',			'' );
+$c->set( '# CONFIG_MFD_TPS65912_I2C is not set',		'' );
+$c->set( '# CONFIG_MFD_AAT2870_CORE is not set',		'' );
+$c->set( '# CONFIG_LEDS_RENESAS_TPU is not set',		'' );
+$c->set( '# CONFIG_HTC_EGPIO is not set',			'' );
+$c->set( '# CONFIG_HTC_I2CPLD is not set',			'' );
+$c->set( '# CONFIG_MTD_NAND_GPIO is not set',			'' );
+$c->set( '# CONFIG_MG_DISK is not set',				'' );
+$c->set( 'CONFIG_SERIAL_MAX3100',				'm' );
+
+$c->set( 'CONFIG_SOUND','m');
+$c->set( 'CONFIG_SND','m');
+$c->set( 'CONFIG_SND_HWDEP','m');
+$c->set( 'CONFIG_SND_RAWMIDI','m');
+$c->set( 'CONFIG_SND_TIMER','m');
+$c->set( 'CONFIG_SND_PCM','m');
+$c->set( 'CONFIG_SND_SEQUENCER','m');
+$c->set( 'CONFIG_SND_VIRMIDI','m');
+$c->set( 'CONFIG_SND_SEQ_DUMMY','m');
+$c->set( 'CONFIG_SND_SEQUENCER_OSS','y');
+$c->set( 'CONFIG_HOSTAUDIO','m');
+$c->set( 'CONFIG_SND_PCM_OSS','m');
+$c->set( 'CONFIG_SND_MIXER_OSS','m');
+$c->set( 'CONFIG_SOUND_OSS_CORE_PRECLAIM', 'y');
+$c->set( 'CONFIG_SND_PCM_OSS_PLUGINS','n');
+$c->set( 'CONFIG_SND_DYNAMIC_MINORS','n');
+$c->set( 'CONFIG_SND_SUPPORT_OLD_API','n');
+$c->set( 'CONFIG_SND_VERBOSE_PROCFS','n');
+$c->set( 'CONFIG_SND_VERBOSE_PRINTK','n');
+$c->set( 'CONFIG_SND_DEBUG','n');
+$c->set( 'CONFIG_SND_DRIVERS','y');
+$c->set( 'CONFIG_SND_DUMMY','n');
+$c->set( 'CONFIG_SND_ALOOP','n');
+$c->set( 'CONFIG_SND_MTPAV','n');
+$c->set( 'CONFIG_SND_SERIAL_U16550','n');
+$c->set( 'CONFIG_SND_MPU401','n');
+$c->set( 'CONFIG_SND_PCI','n');
+$c->set( 'CONFIG_SND_SPI','n');
+$c->set( 'CONFIG_SND_MIPS','n');
+$c->set( 'CONFIG_SND_ARM','n');
+$c->set( 'CONFIG_SND_USB','y');
+$c->set( 'CONFIG_SND_USB_AUDIO','m');
+$c->set( 'CONFIG_SND_USB_UA101','n');
+$c->set( 'CONFIG_SND_USB_CAIAQ','n');
+$c->set( 'CONFIG_SND_USB_6FIRE','n');
+$c->set( 'CONFIG_SND_SOC','n');
+$c->set( 'CONFIG_SOUND_PRIME','n');
+
+$c->set( 'CONFIG_BT','m');
+$c->set( 'CONFIG_BT_BREDR','y');
+$c->set( 'CONFIG_BT_LE','y');
+$c->set( 'CONFIG_BT_RFCOMM','m');
+$c->set( 'CONFIG_BT_RFCOMM_TTY','y');
+$c->set( 'CONFIG_BT_BNEP','n');
+#$c->set( 'CONFIG_BT_BNEP_MC_FILTER','y');
+#$c->set( 'CONFIG_BT_BNEP_PROTO_FILTER','y');
+$c->set( 'CONFIG_BT_HCIBTUSB','m');
+$c->set( 'CONFIG_BT_HCIUART','m');
+
+$c->set( 'CONFIG_BT_HCIUART_H4','n');
+$c->set( 'CONFIG_BT_HCIUART_BCSP','n');
+$c->set( 'CONFIG_BT_HCIUART_ATH3K','n');
+$c->set( 'CONFIG_BT_HCIUART_LL','n');
+$c->set( 'CONFIG_BT_HCIBCM203X','n');
+$c->set( 'CONFIG_BT_HCIBPA10X','n');
+$c->set( 'CONFIG_BT_HCIBFUSB','n');
+$c->set( 'CONFIG_BT_HCIVHCI','n');
+$c->set( 'CONFIG_BT_MRVL','n');
+$c->set( 'CONFIG_BT_ATH3K','n');
+$c->set( 'CONFIG_LOG_BUF_SHIFT', '17' );
+
+$c->set( 'CONFIG_SIGNALFD','y');
+$c->set( 'CONFIG_TASKSTATS','y');
+$c->set( 'CONFIG_TASK_DELAY_ACCT','y');
+$c->set( 'CONFIG_TASK_IO_ACCOUNTING','y');
+$c->set( 'CONFIG_TASK_XACCT','y');
+$c->set( 'CONFIG_SECCOMP','y');
+
+$c->set( 'CONFIG_DEBUG_INFO', 'y' );
+if ( $chip =~ /^(6846|6858)$/ ) {
+	$c->set( 'CONFIG_BCM_WATCHDOG_TIMER','n');
+} else {
+	$c->set( 'CONFIG_BCM_WATCHDOG_TIMER','y');
+}
+$c->set( 'CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC','y');
+$c->set( 'CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE','1');
+$c->set( 'CONFIG_PANIC_TIMEOUT', '1' );  # hard set by arch/mips/bcm963xx/setup.c
+
+$c->set( "CONFIG_DUMMY","m" );
+$c->set( "CONFIG_SYN_COOKIES","y" );
+# To get a core dump of userspace processes
+$c->set( "CONFIG_ELF_CORE","y" );
+
+$c->set( 'CONFIG_NETFILTER_XTABLES',				'y' );
+$c->set( 'CONFIG_IP_NF_ARPTABLES',				'm' );
+$c->set( 'CONFIG_IP_NF_ARPFILTER',				'm' );
+
+$c->set( "CONFIG_MACVLAN","y" );
+$c->set( "CONFIG_VETH","y" );
+
+# LXC dependencies
+$c->set( "CONFIG_CGROUPS","y" );
+$c->set( "CONFIG_PAGE_COUNTER","y" );
+$c->set( "CONFIG_MEMCG","y" );
+$c->set( "CONFIG_MEMCG_SWAP","y" );
+$c->set( "CONFIG_MEMCG_SWAP_ENABLED","y" );
+$c->set( "CONFIG_BLK_CGROUP","y" );
+$c->set( "CONFIG_DEBUG_BLK_CGROUP","y" );
+$c->set( "CONFIG_CGROUP_SCHED","y" );
+$c->set( "CONFIG_FAIR_GROUP_SCHED","y" );
+$c->set( "CONFIG_RT_GROUP_SCHED","y" );
+$c->set( "CONFIG_CGROUP_FREEZER","y" );
+$c->set( "CONFIG_CPUSETS","y" );
+$c->set( "CONFIG_PROC_PID_CPUSET","y" );
+$c->set( "CONFIG_CGROUP_DEVICE","y" );
+$c->set( "CONFIG_CGROUP_CPUACCT","y" );
+$c->set( "CONFIG_CGROUP_DEBUG","y" );
+$c->set( "CONFIG_CHECKPOINT_RESTORE","y" );
+$c->set( "CONFIG_NAMESPACES","y" );
+$c->set( "CONFIG_UTS_NS","y" );
+$c->set( "CONFIG_IPC_NS","y" );
+$c->set( "CONFIG_USER_NS","y" );
+$c->set( "CONFIG_PID_NS","y" );
+$c->set( "CONFIG_NET_NS","y" );
+
+$c->set( "CONFIG_POSIX_MQUEUE","y" );
+$c->set( "CONFIG_FHANDLE","y" );
+
+$c->set( "CONFIG_UNIX_DIAG","y" );
+$c->set( "CONFIG_INET_DIAG","y" );
+$c->set( "CONFIG_PACKET_DIAG","y" );
+$c->set( "CONFIG_NETLINK_DIAG","y" );
+
+$c->set( "CONFIG_LEGACY_PTYS","y" );
+$c->set( "CONFIG_LEGACY_PTY_COUNT","2" );
+$c->set( "CONFIG_BTRFS_FS","y" );
+$c->set( "CONFIG_BTRFS_FS_POSIX_ACL","y" );
+$c->set( "CONFIG_DEBUG_LL", "y" );
+
+$c->set( "CONFIG_BRIDGE", "y");
+$c->set( "CONFIG_BRIDGE_NETFILTER", "y");
+$c->set( "CONFIG_NF_NAT_IPV4", "y");
+$c->set( "CONFIG_IP_NF_FILTER", "y");
+$c->set( "CONFIG_IP_NF_TARGET_MASQUERADE", "y");
+$c->set( "CONFIG_NETFILTER_XT_MATCH_ADDRTYPE", "y");
+$c->set( "CONFIG_NETFILTER_XT_MATCH_CONNTRACK", "y");
+$c->set( "CONFIG_NETFILTER_XT_MATCH_IPVS", "y");
+$c->set( "CONFIG_IP_NF_NAT", "y");
+$c->set( "CONFIG_NF_NAT", "y");
+$c->set( "CONFIG_NF_NAT_NEEDED", "y");
+$c->set( "CONFIG_DEVPTS_MULTIPLE_INSTANCES", "y");
+
+$c->set ("CONFIG_CGROUPS_CPU", "y");
+$c->set ("CONFIG_CGROUPS_CPUACCT", "y");
+$c->set ("CONFIG_CGROUPS_CPUSET", "y");
+$c->set ("CONFIG_CGROUPS_MEMORY", "y");
+$c->set ("CONFIG_CONFIG_AUFS_FS", "y");
+$c->set ("CONFIG_CONFIG_BLK_DEV_DM", "y");
+$c->set ("CONFIG_CONFIG_CGROUP_CPUACCT", "y");
+$c->set ("CONFIG_CONFIG_CGROUP_SCHED", "y");
+$c->set ("CONFIG_CONFIG_CPUSETS", "y");
+$c->set ("CONFIG_CONFIG_MEMCG", "y");
+$c->set ("CONFIG_CGROUP_PIDS", "y");
+$c->set ("CONFIG_MEMCG_KMEM", "y");
+$c->set ("CONFIG_BLK_DEV_THROTTLING", "y");
+$c->set ("CONFIG_IOSCHED_CFQ", "y");
+$c->set ("CONFIG_CFQ_GROUP_IOSCHED", "y");
+$c->set ("CONFIG_CGROUP_PERF", "y");
+$c->set ("CONFIG_CGROUP_HUGETLB", "y");
+$c->set ("CONFIG_NET_CLS_CGROUP", "y");
+$c->set ("CONFIG_CGROUP_NET_PRIO", "y");
+$c->set ("CONFIG_CFS_BANDWIDTH", "y");
+$c->set ("CONFIG_IP_NF_TARGET_REDIRECT", "y");
+$c->set ("CONFIG_IP_VS", "y");
+$c->set ("CONFIG_IP_VS_NFCT", "y");
+$c->set ("CONFIG_IP_VS_PROTO_TCP", "y");
+$c->set ("CONFIG_IP_VS_PROTO_UDP", "y");
+$c->set ("CONFIG_IP_VS_RR", "y");
+$c->set ("CONFIG_EXT3_FS", "y");
+$c->set ("CONFIG_EXT3_FS_XATTR", "y");
+$c->set ("CONFIG_EXT3_FS_POSIX_ACL", "y");
+$c->set ("CONFIG_EXT3_FS_SECURITY", "y");
+$c->set ("CONFIG_EXT4_FS", "y");
+$c->set ("CONFIG_EXT4_FS_POSIX_ACL", "y");
+$c->set ("CONFIG_EXT4_FS_SECURITY", "y");
+$c->set ("CONFIG_AUFS_FS", "y");
+$c->set ("CONFIG_BLK_DEV_DM", "y");
+$c->set ("CONFIG_DM_THIN_PROVISIONING", "y");
+
+$c->write();
diff --git a/utils/docker-ce/misc/Dockerfile b/utils/docker-ce/misc/Dockerfile
new file mode 100644
index 0000000000..a49dd8beb5
--- /dev/null
+++ b/utils/docker-ce/misc/Dockerfile
@@ -0,0 +1,23 @@
+FROM iopsys:latest
+
+LABEL maintainer="jakob.olsson@iopsys.eu"
+LABEL build="docker build -t iopsys ."
+#LABEL run="docker run -it --rm -v ${PWD}:/opt/work stripped"
+
+#EXPOSE 22 80 443
+
+#USER root
+
+CMD [ "/sbin/init" ]
+
+
+#WORKDIR /opt/work
+#
+# Prepare supervisor
+#RUN mkdir -p /var/log/supervisor
+#RUN mkdir -p /etc/supervisor/conf.d/
+#COPY supervisord.conf /etc/supervisor/
+
+## Start entrypoint
+#COPY entrypoint.sh /usr/local/bin/entrypoint.sh
+#ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
diff --git a/utils/docker-ce/misc/usb_setup.sh b/utils/docker-ce/misc/usb_setup.sh
new file mode 100755
index 0000000000..9fb57f42ef
--- /dev/null
+++ b/utils/docker-ce/misc/usb_setup.sh
@@ -0,0 +1,30 @@
+#/bin/bash
+
+# mount with exec permission
+mount -o remount,exec /dev/sda1
+
+
+# copy necessary environment files
+cp -rf ./root-iopsys-brcm63xx-arm/opt/docker /opt/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/share/docker /usr/share/
+cp -rf ./root-iopsys-brcm63xx-arm/etc/docker /etc/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/docker-ce.control /usr/lib/opkg/info/docker-ce.control
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/docker-ce.list /usr/lib/opkg/info/docker-ce.list
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/tini.list /usr/lib/opkg/info/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/info/containerd.list /usr/lib/opkg/info/
+cp -rf ./root-iopsys-brcm63xx-arm/usr/lib/opkg/status /usr/lib/opkg/status
+cp -rf ./root-iopsys-brcm63xx-arm/etc/group /etc/group
+cp -rf ./root-iopsys-brcm63xx-arm/etc/docker/daemon.json /etc/docker/daemon.json
+cp -rf ./root-iopsys-brcm63xx-arm/etc/init.d/dockerd /etc/init.d/dockerd
+cp -rf ./root-iopsys-brcm63xx-arm/etc/passwd /etc/passwd
+cp -rf ./root-iopsys-brcm63xx-arm/etc/shadow /etc/shadow
+
+
+# create softlinks to binaries
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/bin/docker* /usr/bin/
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/bin/container* /usr/bin/
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/bin/tini /usr/bin/
+ln -s $(pwd)/root-iopsys-brcm63xx-arm/usr/sbin/runc /usr/sbin/
+
+# install packages, if not compiled with image (i.e. ethtools, socat, bash, nsenter)
+opkg install *.ipk
\ No newline at end of file
-- 
GitLab