From cc8d8bcf28ad4b6f2ebfdecd3b7496bad6824f85 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 4 Aug 2020 10:29:43 +0200 Subject: [PATCH 1/4] docker-ce: add postinst and prerm script for service start and stop Signed-off-by: Florian Eckert --- utils/docker-ce/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/utils/docker-ce/Makefile b/utils/docker-ce/Makefile index e3496c4f7..aa9af5c1b 100644 --- a/utils/docker-ce/Makefile +++ b/utils/docker-ce/Makefile @@ -133,4 +133,22 @@ define Package/docker-ce/install $(1)/etc/sysctl.d/12-br-netfilter-ip.conf endef +define Package/docker-ce/postinst +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || { + /etc/init.d/dockerd enable + /etc/init.d/dockerd uciadd + /etc/init.d/dockerd start +} +endef + +define Package/docker-ce/prerm +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || { + /etc/init.d/dockerd disable + /etc/init.d/dockerd stop + /etc/init.d/dockerd ucidel +} +endef + $(eval $(call BuildPackage,docker-ce)) From 7034020c13243b1edea836a217d236ef3efc8c73 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 4 Aug 2020 10:30:01 +0200 Subject: [PATCH 2/4] docker-ce: fix hosts type to list Signed-off-by: Florian Eckert --- utils/docker-ce/files/etc/config/dockerd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/docker-ce/files/etc/config/dockerd b/utils/docker-ce/files/etc/config/dockerd index 294b6d184..6e01d0406 100644 --- a/utils/docker-ce/files/etc/config/dockerd +++ b/utils/docker-ce/files/etc/config/dockerd @@ -3,7 +3,7 @@ config globals 'globals' # option alt_config_file "/etc/docker/daemon.json" option data_root "/opt/docker/" option log_level "warn" - option hosts "unix://var/run/docker.sock" + list hosts "unix:///var/run/docker.sock" # If the bip option is changed, dockerd must be restarted. # A service reload is not enough. option bip "172.18.0.1/24" From 138a60407f88fc920cccd1aea5c7e149492d9d74 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 30 Jul 2020 15:12:00 +0200 Subject: [PATCH 3/4] docker-ce: add bridge device to network uci backend Signed-off-by: Florian Eckert --- utils/docker-ce/files/dockerd.init | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/utils/docker-ce/files/dockerd.init b/utils/docker-ce/files/dockerd.init index 464e3c6f4..25f0bd510 100644 --- a/utils/docker-ce/files/dockerd.init +++ b/utils/docker-ce/files/dockerd.init @@ -54,7 +54,7 @@ uciadd() { # Add network interface if ! uci -q get network.docker >/dev/null; then - logger -t "dockerd-init" -p notice "Adding docker default bridge to network uci config (docker0)" + logger -t "dockerd-init" -p notice "Adding docker default interface to network uci config (docker)" uci_quiet add network interface uci_quiet rename network.@interface[-1]="docker" uci_quiet set network.docker.ifname="docker0" @@ -63,9 +63,20 @@ uciadd() { uci_quiet commit network fi + # Add docker bridge device + if ! uci -q get network.docker0 >/dev/null; then + logger -t "dockerd-init" -p notice "Adding docker default bridge device to network uci config (docker0)" + uci_quiet add network device + uci_quiet rename network.@device[-1]="docker0" + uci_quiet set network.docker0.type="bridge" + uci_quiet set network.docker0.name="docker0" + uci_quiet add_list network.docker0.ifname="docker0" + uci_quiet commit network + fi + # Add firewall zone if ! uci -q get firewall.docker >/dev/null; then - logger -t "dockerd-init" -p notice "Adding docker default bridge firewall zone (docker0)" + logger -t "dockerd-init" -p notice "Adding docker default firewall zone to firewall uci config (docker)" uci_quiet add firewall zone uci_quiet rename firewall.@zone[-1]="docker" uci_quiet set firewall.docker.network="docker" @@ -85,11 +96,15 @@ ucidel() { exit 0 } - logger -t "dockerd-init" -p notice "Deleting docker default bridge network from network uci config (docker0)" + logger -t "dockerd-init" -p notice "Deleting docker default bridge device from network uci config (docker0)" + uci_quiet delete network.docker0 + uci_quiet commit network + + logger -t "dockerd-init" -p notice "Deleting docker default interface from network uci config (docker)" uci_quiet delete network.docker uci_quiet commit network - logger -t "dockerd-init" -p notice "Deleting docker default bridge firewall zone from firewall uci config (docker0)" + logger -t "dockerd-init" -p notice "Deleting docker firewall zone from firewall uci config (docker)" uci_quiet delete firewall.docker uci_quiet commit firewall From 54809b2eb4b4db1f230d5c82c96a7e59b3fabadc Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 11 Aug 2020 09:27:03 +0200 Subject: [PATCH 4/4] docker-ce: update PKG_RELEASE Signed-off-by: Florian Eckert --- utils/docker-ce/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/docker-ce/Makefile b/utils/docker-ce/Makefile index aa9af5c1b..aa0c9131a 100644 --- a/utils/docker-ce/Makefile +++ b/utils/docker-ce/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=docker-ce PKG_VERSION:=19.03.12 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=components/cli/LICENSE components/engine/LICENSE