From 5f8faea941ef657ba10d3827101c805bca97528f Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 26 Oct 2023 13:12:53 +0800 Subject: [PATCH] Add docker config --- .buildbot/openwrt/build.sh | 3 +++ daemon.json | 6 ++++++ defaults/48-docker | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 daemon.json create mode 100644 defaults/48-docker diff --git a/.buildbot/openwrt/build.sh b/.buildbot/openwrt/build.sh index 58ba904..70d6306 100755 --- a/.buildbot/openwrt/build.sh +++ b/.buildbot/openwrt/build.sh @@ -111,6 +111,9 @@ mkdir -p files/etc/dropbear chmod 0750 files/etc/dropbear cp ${pwd}/authorized_keys files/etc/dropbear chmod 0400 files/etc/dropbear/authorized_keys +mkdir -p files/etc/docker +chmod 0750 files/etc/docker +cp ${pwd}/daemon.json files/etc/docker mkdir -p files/etc/uci-defaults cp ${pwd}/defaults/* files/etc/uci-defaults diff --git a/daemon.json b/daemon.json new file mode 100644 index 0000000..fe2daff --- /dev/null +++ b/daemon.json @@ -0,0 +1,6 @@ +{ + "log-level": "warn", + "userland-proxy": false, + "iptables": true, + "storage-driver": "btrfs" +} diff --git a/defaults/48-docker b/defaults/48-docker new file mode 100644 index 0000000..10dd738 --- /dev/null +++ b/defaults/48-docker @@ -0,0 +1,14 @@ +VERSION=1 + +[ "$(uci -q get defaults.version.docker)" -ge "$VERSION" ] && exit 0 + +# save version +/sbin/uci set defaults.version.docker="$VERSION" + +/sbin/uci -q batch << EOF +set defaults.version.docker="$VERSION" +commit defaults +set docker.globals=globals +set docker.globals.alt_config_file=/etc/docker/daemon.json +commit docker +EOF