dockerd update to 21.10.9

Signed-off-by: xiangfeidexiaohuo <jsjson@163.com>
This commit is contained in:
xiangfeidexiaohuo 2021-10-24 22:10:54 +08:00
parent 17f4e15c14
commit 682e5c7b7a
4 changed files with 67 additions and 25 deletions

View File

@ -2,7 +2,7 @@
config DOCKER_CGROUP_OPTIONS config DOCKER_CGROUP_OPTIONS
bool "Enable available kernel support for CGroupsV1" bool "Enable available kernel support for CGroupsV1"
default n default y
depends on PACKAGE_dockerd depends on PACKAGE_dockerd
select KERNEL_CGROUP_DEVICE select KERNEL_CGROUP_DEVICE
select KERNEL_CGROUP_FREEZER select KERNEL_CGROUP_FREEZER
@ -47,7 +47,7 @@ menu "Network"
config DOCKER_NET_MACVLAN config DOCKER_NET_MACVLAN
bool "Includes macvlan kernel modules" bool "Includes macvlan kernel modules"
default n default y
select PACKAGE_kmod-macvlan select PACKAGE_kmod-macvlan
select PACKAGE_kmod-dummy select PACKAGE_kmod-dummy
@ -63,7 +63,7 @@ menu "Storage"
config DOCKER_STO_EXT4 config DOCKER_STO_EXT4
bool "Enables support for ext3 or ext4 as the backing filesystem" bool "Enables support for ext3 or ext4 as the backing filesystem"
default n default y
select KERNEL_EXT4_FS_POSIX_ACL select KERNEL_EXT4_FS_POSIX_ACL
select KERNEL_EXT4_FS_SECURITY select KERNEL_EXT4_FS_SECURITY

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=dockerd PKG_NAME:=dockerd
PKG_VERSION:=20.10.8 PKG_VERSION:=20.10.9
PKG_RELEASE:=1 PKG_RELEASE:=$(AUTORELEASE)
PKG_LICENSE:=Apache-2.0 PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE
@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_GIT_URL:=github.com/moby/moby PKG_GIT_URL:=github.com/moby/moby
PKG_GIT_REF:=v$(PKG_VERSION) PKG_GIT_REF:=v$(PKG_VERSION)
PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)? PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)?
PKG_HASH:=2505d00032f5d40ead5ac779c2840303dcead04713c93ba974be4c19b3ab8d0a PKG_HASH:=359e8854d0d51bc884d434f182f64ca62f25fbbe7b9c6a336eb09f212fe8cc9a
PKG_GIT_SHORT_COMMIT:=75249d8 # SHA1 used within the docker executables PKG_GIT_SHORT_COMMIT:=79ea9d3 # SHA1 used within the docker executables
PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com> PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
@ -34,8 +34,8 @@ define Package/dockerd
TITLE:=Docker Community Edition Daemon TITLE:=Docker Community Edition Daemon
URL:=https://www.docker.com/ URL:=https://www.docker.com/
DEPENDS:=$(GO_ARCH_DEPENDS) +btrfs-progs +ca-certificates +containerd +libdevmapper +libnetwork +tini \ DEPENDS:=$(GO_ARCH_DEPENDS) +btrfs-progs +ca-certificates +containerd +libdevmapper +libnetwork +tini \
+KERNEL_SECCOMP:libseccomp +iptables-mod-extra +kmod-br-netfilter +kmod-ikconfig +kmod-nf-conntrack-netlink +kmod-nf-ipvs \ +@KERNEL_NAMESPACES +KERNEL_SECCOMP:libseccomp +iptables-mod-extra +kmod-br-netfilter +kmod-ikconfig \
+kmod-nf-nat +kmod-veth +kmod-nf-conntrack-netlink +kmod-nf-ipvs +kmod-nf-nat +kmod-veth
USERID:=docker:docker USERID:=docker:docker
MENU:=1 MENU:=1
endef endef
@ -121,6 +121,9 @@ define Package/dockerd/install
$(INSTALL_DIR) $(1)/usr/share/docker/ $(INSTALL_DIR) $(1)/usr/share/docker/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/check-config.sh $(1)/usr/share/docker/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/check-config.sh $(1)/usr/share/docker/
$(INSTALL_DIR) $(1)/etc/docker
$(INSTALL_CONF) ./files/daemon.json $(1)/etc/docker/
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd

View File

@ -0,0 +1,4 @@
{
"data-root": "/opt/docker/",
"log-level": "warn"
}

View File

@ -3,9 +3,8 @@
USE_PROCD=1 USE_PROCD=1
START=99 START=99
EXTRA_COMMANDS="uciadd ucidel" extra_command "uciadd" "<interface> <device> <zone> Add docker bridge configuration to network and firewall uci config"
EXTRA_HELP=" uciadd <interface> <device> <zone> Add docker bridge configuration to network and firewall uci config extra_command "ucidel" "<interface> <device> <zone> Delete docker bridge configuration from network and firewall uci config"
ucidel <interface> <device> <zone> Delete docker bridge configuration from network and firewall uci config"
DOCKER_CONF_DIR="/tmp/dockerd" DOCKER_CONF_DIR="/tmp/dockerd"
DOCKERD_CONF="${DOCKER_CONF_DIR}/daemon.json" DOCKERD_CONF="${DOCKER_CONF_DIR}/daemon.json"
@ -18,6 +17,28 @@ json_add_array_string() {
json_add_string "" "${1}" json_add_string "" "${1}"
} }
find_network_device() {
local device="${1}"
local device_section=""
check_device() {
local cfg="${1}"
local device="${2}"
local type name
config_get type "${cfg}" type
config_get name "${cfg}" name
[ "${type}" = "bridge" ] && [ "${name}" = "${device}" ] \
&& device_section="${cfg}"
}
config_load network
config_foreach check_device device "${device}"
echo "${device_section}"
}
boot() { boot() {
uciadd uciadd
rc_procd start_service rc_procd start_service
@ -41,7 +62,7 @@ uciadd() {
# Add network interface # Add network interface
if ! uci_quiet get network.${iface}; then if ! uci_quiet get network.${iface}; then
logger -t "dockerd-init" -p notice "Adding docker default interface to network uci config (${iface})" logger -t "dockerd-init" -p notice "Adding interface '${iface}' to network config"
uci_quiet add network interface uci_quiet add network interface
uci_quiet rename network.@interface[-1]="${iface}" uci_quiet rename network.@interface[-1]="${iface}"
uci_quiet set network.@interface[-1].ifname="${device}" uci_quiet set network.@interface[-1].ifname="${device}"
@ -51,22 +72,21 @@ uciadd() {
fi fi
# Add docker bridge device # Add docker bridge device
if ! uci_quiet get network.${device}; then if [ "$(find_network_device "$device")" = "" ]; then
logger -t "dockerd-init" -p notice "Adding docker default bridge device to network uci config (${device})" logger -t "dockerd-init" -p notice "Adding bridge device '${device}' to network config"
uci_quiet add network device uci_quiet add network device
uci_quiet rename network.@device[-1]="${device}"
uci_quiet set network.@device[-1].type="bridge" uci_quiet set network.@device[-1].type="bridge"
uci_quiet set network.@device[-1].name="${device}" uci_quiet set network.@device[-1].name="${device}"
uci_quiet add_list network.@device[-1].ifname="${device}"
uci_quiet commit network uci_quiet commit network
else
logger -t "dockerd-init" -p notice "Bridge device '${device}' already defined in network config"
fi fi
# Add firewall zone # Add firewall zone
if ! uci_quiet get firewall.${zone}; then if ! uci_quiet get firewall.${zone}; then
logger -t "dockerd-init" -p notice "Adding docker default firewall zone to firewall uci config (${zone})" logger -t "dockerd-init" -p notice "Adding firewall zone '${zone}' to firewall config"
uci_quiet add firewall zone uci_quiet add firewall zone
uci_quiet rename firewall.@zone[-1]="${zone}" uci_quiet rename firewall.@zone[-1]="${zone}"
uci_quiet set firewall.@zone[-1].network="${iface}"
uci_quiet set firewall.@zone[-1].input="ACCEPT" uci_quiet set firewall.@zone[-1].input="ACCEPT"
uci_quiet set firewall.@zone[-1].output="ACCEPT" uci_quiet set firewall.@zone[-1].output="ACCEPT"
uci_quiet set firewall.@zone[-1].forward="ACCEPT" uci_quiet set firewall.@zone[-1].forward="ACCEPT"
@ -74,6 +94,13 @@ uciadd() {
uci_quiet commit firewall uci_quiet commit firewall
fi fi
# Add interface to firewall zone
if uci_quiet get firewall.${zone}; then
uci_quiet del_list firewall.${zone}.network="${iface}"
uci_quiet add_list firewall.${zone}.network="${iface}"
uci_quiet commit firewall
fi
reload_config reload_config
} }
@ -93,21 +120,29 @@ ucidel() {
exit 0 exit 0
} }
if uci_quiet get network.${device}; then # Remove network device
logger -t "dockerd-init" -p notice "Deleting docker default bridge device from network uci config (${device})" if uci_quiet delete network.$(find_network_device "${device}"); then
uci_quiet delete network.${device} logger -t "dockerd-init" -p notice "Deleting bridge device '${device}' from network config"
uci_quiet commit network uci_quiet commit network
fi fi
# Remove network interface
if uci_quiet get network.${iface}; then if uci_quiet get network.${iface}; then
logger -t "dockerd-init" -p notice "Deleting docker default interface from network uci config (${iface})" logger -t "dockerd-init" -p notice "Deleting interface '${iface}' from network config"
uci_quiet delete network.${iface} uci_quiet delete network.${iface}
uci_quiet commit network uci_quiet commit network
fi fi
# Remove interface from firewall zone
if uci_quiet get firewall.${zone}; then if uci_quiet get firewall.${zone}; then
logger -t "dockerd-init" -p notice "Deleting docker firewall zone from firewall uci config (${zone})" logger -t "dockerd-init" -p notice "Deleting network interface '${iface}' in zone '${zone}' from firewall config"
uci_quiet del_list firewall.${zone}.network="${iface}"
uci_quiet commit firewall
# Remove Firewall zone if network is empty
if ! uci_quiet get firewall.${zone}.network; then
logger -t "dockerd-init" -p notice "Deleting firewall zone '${zone}' from firewall config"
uci_quiet delete firewall.${zone} uci_quiet delete firewall.${zone}
fi
uci_quiet commit firewall uci_quiet commit firewall
fi fi