{"id":2244,"date":"2026-08-08T09:08:00","date_gmt":"2026-08-08T09:08:00","guid":{"rendered":"https:\/\/alexisiumus.ru\/?p=2244"},"modified":"2026-08-08T09:08:02","modified_gmt":"2026-08-08T09:08:02","slug":"%d1%81%d0%be%d0%b7%d0%b4%d0%b0%d0%bd%d0%b8%d0%b5-openwrt-%d0%ba%d0%be%d0%bd%d1%82%d0%b5%d0%b9%d0%bd%d0%b5%d1%80%d0%b0","status":"publish","type":"post","link":"https:\/\/alexisiumus.ru\/?p=2244","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 OpenWRT \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0442\u044c 192.168.0.0\/24. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0441\u0442 \u0441 \u0434\u0432\u0443\u043c\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u043a\u0430\u0440\u0442\u0430\u043c\u0438, \u043e\u0434\u043d\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 (\u0430) enp6s0 \u0438\u043c\u0435\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 192.168.0.162\/24, &#8212; \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u0443 \u043a\u0430\u0442\u0440\u0443 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u044c \u0441 internet \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e SSH. \u0414\u0440\u0443\u0433\u0430\u044f \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430 (\u0431) enp7s0 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0430. \u041d\u0430 \u044d\u0442\u043e\u043c \u0445\u043e\u0441\u0442\u0435 (192.168.0.162\/24) \u0438 (\u043d\u0435\u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043a\u0430\u0442\u0440\u0430) \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 docker. \u0412 \u044d\u0442\u043e\u043c \u0434\u043e\u043a\u0435\u0440\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 OpenWRT, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043e\u0434\u0438\u043d \u043d\u0430 \u0441\u0435\u0442\u044c 192.168.0.0\/24 (WAN \u0434\u043b\u044f Openwrt) \u0441 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c 192.168.0.200, \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0430 \u043d\u0435\u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0445\u043e\u0441\u0442\u0430 (LAN \u0434\u043b\u044f Openwrt) c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c 192.168.200.1\/24. \u0412 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441 OpenWRT \u043d\u0430\u0434\u043e \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u044c \u043c\u043d\u0435 Dockerfile \u0438 docker-compose.yml. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a web \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 Openwrt \u043a\u0430\u043a \u043f\u043e LAN \u0442\u0430\u043a \u0438 \u043f\u043e WAN \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0438\u0436\u0435 \u2014 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 \u0431\u0430\u0437\u0435 \u0434\u0432\u0443\u0445 <code>macvlan<\/code>-\u0441\u0435\u0442\u0435\u0439 Docker:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WAN OpenWRT: \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0435\u0442\u0438 <code>enp6s0<\/code>, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 IP <code>192.168.0.200\/24<\/code>.<\/li>\n\n\n\n<li>LAN OpenWRT: \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u0435 <code>enp7s0<\/code>, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 IP <code>192.168.200.1\/24<\/code>.<\/li>\n\n\n\n<li>LuCI\/Web \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430:<\/li>\n\n\n\n<li>\u0438\u0437 LAN: <code>http:\/\/192.168.200.1<\/code> \u0438 <code>https:\/\/192.168.200.1<\/code><\/li>\n\n\n\n<li>\u0438\u0437 WAN-\u0441\u0435\u0442\u0438 <code>192.168.0.0\/24<\/code>: <code>http:\/\/192.168.0.200<\/code> \u0438 <code>https:\/\/192.168.0.200<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0432\u0430\u0448 \u0440\u043e\u0443\u0442\u0435\u0440\/\u0448\u043b\u044e\u0437 \u0432 \u0441\u0435\u0442\u0438 <code>192.168.0.0\/24<\/code> \u0438\u043c\u0435\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 <code>192.168.0.1<\/code>;<\/li>\n\n\n\n<li>\u0430\u0434\u0440\u0435\u0441 <code>192.168.0.200<\/code> \u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d DHCP-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c;<\/li>\n\n\n\n<li><code>enp7s0<\/code> \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c\u0443 LAN-\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443: \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440, \u0442\u043e\u0447\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0434\u0440\u0443\u0433\u043e\u0439 PC \u0438 \u0442.\u043f.;<\/li>\n\n\n\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Docker Compose v2 \u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 Docker \u0441 BuildKit.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0445\u043e\u0441\u0442\u0430<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c <code>enp7s0<\/code> \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u043d\u0435\u0439 \u043d\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 DHCP-\u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0445\u043e\u0441\u0442\u0430.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ip link set enp6s0 up\nsudo ip link set enp7s0 up\n\n# \u0415\u0441\u043b\u0438 \u043d\u0430 enp7s0 \u0432\u0434\u0440\u0443\u0433 \u0435\u0441\u0442\u044c \u0430\u0434\u0440\u0435\u0441, \u0443\u0431\u0435\u0440\u0438\u0442\u0435 \u0435\u0433\u043e.\n# \u041d\u0435 \u0442\u0440\u043e\u0433\u0430\u0439\u0442\u0435 enp6s0, \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0451 \u0443 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\/SSH.\nsudo ip addr flush dev enp7s0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f macvlan:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ip link set enp6s0 promisc on\nsudo ip link set enp7s0 promisc on<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 NetworkManager\/systemd-networkd \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 <code>enp7s0<\/code>, \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0435\u0451 \u0432 unmanaged \u0438\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0441 \u043d\u0435\u0451 DHCP\/\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441. \u0418\u043d\u0430\u0447\u0435 \u0445\u043e\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u0448\u0430\u0442\u044c LAN-\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443 OpenWRT.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. Dockerfile<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p ~\/openwrt-docker\ncd ~\/openwrt-docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0444\u0430\u0439\u043b <code>Dockerfile<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># syntax=docker\/dockerfile:1.8\n\nARG OPENWRT_TAG=23.05.4\nFROM openwrt\/rootfs:${OPENWRT_TAG}\n\nARG ROOT_PASSWORD=ChangeMe_Strong\nENV TZ=UTC\n\nRUN set -eux; \\\n    opkg update; \\\n    opkg install --force-overwrite --force-space \\\n        luci-ssl \\\n        uhttpd \\\n        dnsmasq \\\n        firewall4 \\\n        dropbear \\\n        ip-full \\\n        ca-bundle \\\n        openssl-util; \\\n    rm -rf \/var\/opkg-lists; \\\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd; \\\n    for s in boot network firewall dnsmasq dropbear uhttpd rpcd sysctl urandom_system; do \\\n        if &#91; -x \"\/etc\/init.d\/$s\" ]; then \"\/etc\/init.d\/$s\" enable || true; fi; \\\n    done\n\nCOPY &lt;&lt;'EOF' \/entrypoint.sh\n#!\/bin\/sh\nset -e\n\n: \"${HOSTNAME:=openwrt}\"\n: \"${WAN_MAC:=02:42:c0:a8:00:c8}\"\n: \"${LAN_MAC:=02:42:c0:a8:c8:01}\"\n: \"${WAN_IP:=192.168.0.200}\"\n: \"${WAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_GATEWAY:=192.168.0.1}\"\n: \"${WAN_DNS:=192.168.0.1}\"\n: \"${LAN_IP:=192.168.200.1}\"\n: \"${LAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_WEB_ALLOW:=192.168.0.0\/24}\"\n\n# \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f ROOT_PASSWORD.\n# \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0443\u0436\u0435 \u043c\u0435\u043d\u044f\u043b\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0444\u0430\u0439\u043b-\u043c\u0430\u0440\u043a\u0435\u0440 \u043d\u0435 \u0434\u0430\u0441\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0435.\nif &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd\n    touch \/etc\/.docker_root_password_set\nfi\n\nhostname \"${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n\nnon_lo_ifs() {\n    ip -o link show 2&gt;\/dev\/null | awk -F': ' '{print $2}' | cut -d'@' -f1 | grep -E '^eth&#91;0-9]+$' || true\n}\n\n# \u0416\u0434\u0451\u043c, \u043f\u043e\u043a\u0430 Docker \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043e\u0431\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.\ni=0\nwhile &#91; \"$i\" -lt 15 ]; do\n    cnt=$(non_lo_ifs | wc -l)\n    &#91; \"$cnt\" -ge 2 ] &amp;&amp; break\n    sleep 1\n    i=$((i+1))\ndone\n\nfind_if_by_mac() {\n    want=$(echo \"$1\" | tr 'A-F' 'a-f')\n    for p in \/sys\/class\/net\/*; do\n        n=\"${p##*\/}\"\n        &#91; \"$n\" = \"lo\" ] &amp;&amp; continue\n        mac=$(cat \"$p\/address\" 2&gt;\/dev\/null || true)\n        mac=$(echo \"$mac\" | tr 'A-F' 'a-f')\n        if &#91; -n \"$mac\" ] &amp;&amp; &#91; \"$mac\" = \"$want\" ]; then\n            echo \"$n\"\n            return 0\n        fi\n    done\n    return 1\n}\n\nWAN_IF=$(find_if_by_mac \"$WAN_MAC\" || true)\nLAN_IF=$(find_if_by_mac \"$LAN_MAC\" || true)\n\n# \u0415\u0441\u043b\u0438 MAC-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c, \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432.\nif &#91; -z \"$WAN_IF\" ] || &#91; -z \"$LAN_IF\" ] || &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    set -- $(non_lo_ifs)\n    if &#91; -z \"$WAN_IF\" ]; then\n        WAN_IF=\"$1\"\n    fi\n    if &#91; -z \"$LAN_IF\" ] || &#91; \"$LAN_IF\" = \"$WAN_IF\" ]; then\n        shift 2&gt;\/dev\/null || true\n        LAN_IF=\"$1\"\n    fi\nfi\n\n: \"${WAN_IF:=eth0}\"\n: \"${LAN_IF:=eth1}\"\nif &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    LAN_IF=\"eth1\"\nfi\n\necho \"OpenWRT container: WAN=${WAN_IF}, LAN=${LAN_IF}\"\n\ncat &gt; \/etc\/config\/network &lt;&lt;NETWORK\nconfig interface 'loopback'\n    option device 'lo'\n    option proto 'static'\n    option ipaddr '127.0.0.1'\n    option netmask '255.0.0.0'\n\nconfig interface 'wan'\n    option device '${WAN_IF}'\n    option proto 'static'\n    option ipaddr '${WAN_IP}'\n    option netmask '${WAN_NETMASK}'\n    option gateway '${WAN_GATEWAY}'\n    list dns '${WAN_DNS}'\n    option defaultroute '1'\n\nconfig interface 'lan'\n    option device '${LAN_IF}'\n    option proto 'static'\n    option ipaddr '${LAN_IP}'\n    option netmask '${LAN_NETMASK}'\nNETWORK\n\n# \u0423\u0434\u0430\u043b\u044f\u0435\u043c default route, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0433 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c Docker.\n# OpenWRT \u0441\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 default route \u0447\u0435\u0440\u0435\u0437 WAN_GATEWAY.\nwhile ip route del default 2&gt;\/dev\/null; do :; done\n\nif &#91; -f \/etc\/config\/system ]; then\n    (\n        set +e\n        uci -q set system.@system&#91;0].hostname=\"${HOSTNAME}\"\n        uci commit system\n    )\nfi\n\nif &#91; -f \/etc\/config\/dhcp ]; then\n    (\n        set +e\n        uci -q set dhcp.lan=dhcp\n        uci set dhcp.lan.interface=lan\n        uci set dhcp.lan.start=100\n        uci set dhcp.lan.limit=150\n        uci set dhcp.lan.leasetime=12h\n\n        uci -q set dhcp.wan=dhcp\n        uci set dhcp.wan.interface=wan\n        uci set dhcp.wan.ignore=1\n\n        uci commit dhcp\n    )\nfi\n\nensure_web_rule() {\n    name=\"$1\"\n    port=\"$2\"\n\n    if ! uci -q get \"firewall.${name}\" &gt;\/dev\/null 2&gt;&amp;1; then\n        uci set \"firewall.${name}=rule\"\n    fi\n\n    uci set \"firewall.${name}.name=${name}\"\n    uci set \"firewall.${name}.src=wan\"\n    uci set \"firewall.${name}.proto=tcp\"\n    uci set \"firewall.${name}.dest_port=${port}\"\n    uci set \"firewall.${name}.target=ACCEPT\"\n\n    if &#91; -n \"${WAN_WEB_ALLOW}\" ]; then\n        uci set \"firewall.${name}.src_ip=${WAN_WEB_ALLOW}\"\n    else\n        uci -q delete \"firewall.${name}.src_ip\"\n    fi\n}\n\nif &#91; -f \/etc\/config\/firewall ]; then\n    (\n        set +e\n        ensure_web_rule allow_http_wan 80\n        ensure_web_rule allow_https_wan 443\n        uci commit firewall\n    )\nfi\n\n# \u0421\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f HTTPS\/LuCI.\nif &#91; ! -s \/etc\/uhttpd.crt ] || &#91; ! -s \/etc\/uhttpd.key ]; then\n    if command -v openssl &gt;\/dev\/null 2&gt;&amp;1; then\n        openssl req -x509 -newkey rsa:2048 -nodes -days 825 \\\n            -keyout \/etc\/uhttpd.key -out \/etc\/uhttpd.crt \\\n            -subj \"\/CN=${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n        chmod 600 \/etc\/uhttpd.key 2&gt;\/dev\/null || true\n    fi\nfi\n\nexec \/sbin\/init\nEOF\n\nRUN chmod +x \/entrypoint.sh\n\nEXPOSE 80 443\n\nENTRYPOINT &#91;\"\/entrypoint.sh\"]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u0430\u0436\u043d\u043e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ChangeMe_Strong<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c root \u0434\u043b\u044f LuCI\/SSH.<\/li>\n\n\n\n<li>\u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u0448\u043b\u044e\u0437 \u043d\u0435 <code>192.168.0.1<\/code>, \u043f\u043e\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u0438 \u0432 <code>Dockerfile<\/code>\/<code>docker-compose.yml<\/code>, \u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u0441\u0435\u0442\u0435\u0439.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. docker-compose.yml<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 <code>docker-compose.yml<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:\n  openwrt:\n    build:\n      context: .\n      args:\n        OPENWRT_TAG: \"23.05.4\"\n        ROOT_PASSWORD: \"ChangeMe_Strong\"\n    image: openwrt-macvlan:23.05\n    container_name: openwrt\n    hostname: openwrt\n    restart: unless-stopped\n    stop_grace_period: 30s\n\n    # \u0414\u043b\u044f OpenWRT \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c privileged.\n    # \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c capabilities, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043f\u0440\u0430\u0432\u0430.\n    privileged: true\n\n    environment:\n      TZ: \"UTC\"\n      HOSTNAME: \"openwrt\"\n\n      # MAC-\u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f entrypoint-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c eth0\/eth1.\n      WAN_MAC: \"02:42:c0:a8:00:c8\"\n      LAN_MAC: \"02:42:c0:a8:c8:01\"\n\n      # \u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 OpenWRT.\n      WAN_IP: \"192.168.0.200\"\n      WAN_NETMASK: \"255.255.255.0\"\n      WAN_GATEWAY: \"192.168.0.1\"\n      WAN_DNS: \"192.168.0.1\"\n\n      LAN_IP: \"192.168.200.1\"\n      LAN_NETMASK: \"255.255.255.0\"\n\n      # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b WAN-\u0441\u0435\u0442\u0438.\n      # \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e 192.168.0.0\/24.\n      # \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:\n      # WAN_WEB_ALLOW: \"\"\n      WAN_WEB_ALLOW: \"192.168.0.0\/24\"\n\n    volumes:\n      # \u041d\u0443\u0436\u043d\u044b \u043c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430 \u0445\u043e\u0441\u0442\u0430 \u0434\u043b\u044f nftables\/conntrack\/NAT.\n      - \/lib\/modules:\/lib\/modules:ro\n\n      # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e OpenWRT \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\n      - openwrt-etc:\/etc\n\n    sysctls:\n      - net.ipv4.ip_forward=1\n      - net.ipv4.conf.all.rp_filter=0\n      - net.ipv4.conf.default.rp_filter=0\n      - net.ipv4.conf.all.send_redirects=0\n      - net.ipv4.conf.default.send_redirects=0\n      - net.ipv4.conf.all.accept_redirects=0\n      - net.ipv4.conf.default.accept_redirects=0\n\n    networks:\n      wan:\n        ipv4_address: 192.168.0.200\n        mac_address: \"02:42:c0:a8:00:c8\"\n        priority: 1000\n      lan:\n        ipv4_address: 192.168.200.1\n        mac_address: \"02:42:c0:a8:c8:01\"\n        priority: 900\n\nnetworks:\n  wan:\n    driver: macvlan\n    driver_opts:\n      parent: enp6s0\n    enable_ipv6: false\n    ipam:\n      config:\n        - subnet: 192.168.0.0\/24\n          gateway: 192.168.0.1\n          # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c Docker \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\n          # \u0415\u0441\u043b\u0438 compose \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 ip_range, \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443.\n          ip_range: 192.168.0.200\/32\n\n  lan:\n    driver: macvlan\n    driver_opts:\n      parent: enp7s0\n    enable_ipv6: false\n    ipam:\n      config:\n        - subnet: 192.168.200.0\/24\n          # 192.168.200.254 \u0437\u0434\u0435\u0441\u044c -- \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 placeholder-\u0448\u043b\u044e\u0437 \u0434\u043b\u044f IPAM Docker.\n          # \u0421\u0430\u043c OpenWRT \u0431\u0443\u0434\u0435\u0442 192.168.200.1.\n          # \u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 192.168.200.254 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.\n          gateway: 192.168.200.254\n          # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c Docker \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\n          # \u0415\u0441\u043b\u0438 compose \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 ip_range, \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443.\n          ip_range: 192.168.200.1\/32\n\nvolumes:\n  openwrt-etc:<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u0441\u0442\u0430\u0440\u044b\u0439 Docker Compose \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>mac_address<\/code> \u0438\u043b\u0438 <code>priority<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>services.openwrt.networks.*<\/code>, \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438. \u0422\u043e\u0433\u0434\u0430 \u0432\u0430\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0435\u0442\u0435\u0439: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 <code>wan<\/code>, \u043f\u043e\u0442\u043e\u043c <code>lan<\/code>. \u0412 entrypoint \u0435\u0441\u0442\u044c fallback \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 <code>Dockerfile<\/code> \u0438 <code>docker-compose.yml<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose build --pull\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose logs -f openwrt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043b\u043e\u0433\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>OpenWRT container: WAN=eth0, LAN=eth1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ip -br addr<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c WAN-\u0448\u043b\u044e\u0437:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ping -c 3 192.168.0.1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 NAT OpenWRT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ping -c 3 8.8.8.8<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u043b\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ping -c 3 1.1.1.1<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u0414\u043e\u0441\u0442\u0443\u043f \u043a web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 OpenWRT<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0418\u0437 LAN-\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 OpenWRT<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a \u0441\u0435\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0438\u0441\u0438\u0442 \u043d\u0430 <code>enp7s0<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c DHCP \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 <code>192.168.200.100<\/code>&#8212;<code>192.168.200.249<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;192.168.200.1\nhttps:\/\/192.168.200.1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0418\u0437 \u0432\u0430\u0448\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 192.168.0.0\/24<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421 \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0441\u0435\u0442\u0438 <code>192.168.0.0\/24<\/code> \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;192.168.0.200\nhttps:\/\/192.168.0.200<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">HTTPS \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435, \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u043b\u0438 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041b\u043e\u0433\u0438\u043d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0430\u0440\u043e\u043b\u044c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ChangeMe_Strong<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u043b\u0438 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 <code>Dockerfile<\/code> \u0432 <code>ARG ROOT_PASSWORD<\/code> \u0438 \u0432 <code>docker-compose.yml<\/code> \u0432 <code>build.args.ROOT_PASSWORD<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 LuCI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>System -&gt; Administration<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">6. \u0412\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e Docker-\u0445\u043e\u0441\u0442\u0430<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 <code>macvlan<\/code> Docker-\u0445\u043e\u0441\u0442 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u043e \u0435\u0441\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0448\u0438\u043d \u0432 \u0441\u0435\u0442\u0438 <code>192.168.0.0\/24<\/code> \u0438 <code>192.168.200.0\/24<\/code> \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c, \u0430 \u0432\u043e\u0442 \u0441\u0430\u043c \u0445\u043e\u0441\u0442 <code>192.168.0.162<\/code> \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c <code>192.168.0.200<\/code> \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e macvlan-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 macvlan-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f WAN-\u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a OpenWRT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ip link add link enp6s0 name host-wan type macvlan mode bridge\nsudo ip addr add 192.168.0.201\/32 dev host-wan\nsudo ip link set host-wan up\nsudo ip route add 192.168.0.200\/32 dev host-wan<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f LAN-\u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a OpenWRT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ip link add link enp7s0 name host-lan type macvlan mode bridge\nsudo ip addr add 192.168.200.253\/32 dev host-lan\nsudo ip link set host-lan up\nsudo ip route add 192.168.200.1\/32 dev host-lan<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441 \u0445\u043e\u0441\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;192.168.0.200\nhttp:\/\/192.168.200.1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>systemd-networkd<\/code>, <code>rc.local<\/code>, <code>NetworkManager dispatcher<\/code> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432 \u0432\u0430\u0448\u0435\u043c \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0435.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">7. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430, \u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0438\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f WAN:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>services.openwrt.environment.WAN_IP<\/code><\/li>\n\n\n\n<li><code>services.openwrt.networks.wan.ipv4_address<\/code><\/li>\n\n\n\n<li><code>networks.wan.ipam.config[0].subnet<\/code><\/li>\n\n\n\n<li><code>networks.wan.ipam.config[0].gateway<\/code>, \u0435\u0441\u043b\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0448\u043b\u044e\u0437<\/li>\n\n\n\n<li>\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 <code>WAN_GATEWAY<\/code>, <code>WAN_DNS<\/code>, <code>WAN_WEB_ALLOW<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f LAN:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>services.openwrt.environment.LAN_IP<\/code><\/li>\n\n\n\n<li><code>services.openwrt.networks.lan.ipv4_address<\/code><\/li>\n\n\n\n<li><code>networks.lan.ipam.config[0].subnet<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0442\u043e\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose down\ndocker compose up -d<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">8. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e OpenWRT<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 Docker volume <code>openwrt-etc<\/code>. \u0427\u0442\u043e\u0431\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0435\u0451 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0438\u0437 \u043e\u0431\u0440\u0430\u0437\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose down\ndocker volume ls\ndocker volume rm &lt;\u0438\u043c\u044f_\u043f\u0440\u043e\u0435\u043a\u0442\u0430&gt;_openwrt-etc\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0430\u043f\u043a\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>openwrt-docker<\/code>, volume \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openwrt-docker_openwrt-etc<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">9. \u0412\u0430\u0436\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>LuCI \u043d\u0430 WAN-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u2014 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0430\u0441\u043d\u043e, \u0435\u0441\u043b\u0438 WAN \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u043e\u043c.<br>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0448\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b WAN \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   192.168.0.0\/24<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   WAN_WEB_ALLOW: \"192.168.0.0\/24\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u043b\u0443\u0447\u0448\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   WAN_WEB_ALLOW: \"192.168.0.162\/32\"<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>SSH \u0438\u0437 WAN \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d. \u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043d \u0442\u043e\u043b\u044c\u043a\u043e web 80\/443. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d SSH \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b WAN, \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0432\u0435\u0441\u044c WAN, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c VPN \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.<\/li>\n\n\n\n<li>\u041f\u0430\u0440\u043e\u043b\u044c root \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u044c.<\/li>\n\n\n\n<li>\u0415\u0441\u043b\u0438 <code>enp7s0<\/code> \u0438 <code>enp6s0<\/code> \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u0443 \u0431\u0435\u0437 VLAN, LAN-\u0441\u0435\u0433\u043c\u0435\u043d\u0442 OpenWRT \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c L2-\u0434\u043e\u043c\u0435\u043d\u0435 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e. \u042d\u0442\u043e \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\/VLAN \u0434\u043b\u044f <code>enp7s0<\/code>.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">10. \u041a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ip -br addr<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lo               UNKNOWN        127.0.0.1\/8\neth0             UP             192.168.0.200\/24\neth1             UP             192.168.200.1\/24<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ip route<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c default route \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0448 \u0448\u043b\u044e\u0437 <code>192.168.0.1<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Firewall-\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f WAN-web:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt uci show firewall | grep allow_http\ndocker exec -it openwrt uci show firewall | grep allow_https<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;192.168.200.1\nhttp:\/\/192.168.0.200<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">root@panel:\/opt\/openwrt# docker compose build &#8212;pull<br>[+] Building 6.8s (4\/4) FINISHED docker:default<br>=&gt; [openwrt internal] load build definition from Dockerfile 0.0s<br>=&gt; =&gt; transferring dockerfile: 5.48kB 0.0s<br>=&gt; [openwrt] resolve image config for docker-image:\/\/docker.io\/docker\/dockerfile:1.8 2.4s<br>=&gt; [openwrt] docker-image:\/\/docker.io\/docker\/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 3.2s<br>=&gt; =&gt; resolve docker.io\/docker\/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 0.0s<br>=&gt; =&gt; sha256:1d7e21b9eae3317824ebc8707e591a810a37dff6aff8e1d175f7d8c95a3aa532 12.09MB \/ 12.09MB 2.4s<br>=&gt; =&gt; sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 8.40kB \/ 8.40kB 0.0s<br>=&gt; =&gt; sha256:dde28735fbb848299b7a43b7561d828b89c76f84f745c31896a7a7efbf93851a 482B \/ 482B 0.0s<br>=&gt; =&gt; sha256:265d11c3a0f3387fc23a28141d04918dae4cfa0b0ff311f958e05b23f772db95 1.26kB \/ 1.26kB 0.0s<br>=&gt; =&gt; extracting sha256:1d7e21b9eae3317824ebc8707e591a810a37dff6aff8e1d175f7d8c95a3aa532 0.7s<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">=&gt; ERROR [openwrt internal] load metadata for docker.io\/openwrt\/rootfs:23.05.4 1.1s<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h2 class=\"wp-block-heading\">[openwrt internal] load metadata for docker.io\/openwrt\/rootfs:23.05.4:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">failed to solve: openwrt\/rootfs:23.05.4: docker.io\/openwrt\/rootfs:23.05.4: not found<\/p>\n<\/blockquote>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0448\u0438\u0431\u043a\u0430 <code>openwrt\/rootfs:23.05.4: not found<\/code> \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u043e \u0434\u0432\u0443\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u0424\u043e\u0440\u043c\u0430\u0442 \u0442\u0435\u0433\u043e\u0432:<\/strong> \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Docker Hub (<code>openwrt\/rootfs<\/code>) \u0442\u0435\u0433\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u0422\u0435\u0433\u0430 <code>23.05.4<\/code> \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0435\u0441\u0442\u044c \u0442\u0435\u0433\u0438 \u0432\u0438\u0434\u0430 <code>x86-64-23.05.4<\/code> \u0438\u043b\u0438 <code>x86-64-23.05.5<\/code>.<\/li>\n\n\n\n<li><strong>\u0421\u043c\u0435\u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:<\/strong> \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OpenWrt \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0437\u044b \u0441 <code>openwrtorg\/rootfs<\/code> \u043d\u0430 <code>openwrt\/rootfs<\/code>, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0443 \u0441 \u043a\u044d\u0448\u0435\u043c Docker.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u0435\u0433\u043e\u0432 Docker Hub, <strong>\u0441\u0430\u043c\u044b\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 <code>rootfs<\/code> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenWrt \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044f \u0435\u0433\u043e \u0432 Docker.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0443 \u0432\u0435\u0440\u0441\u0438\u044e OpenWrt \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 (x86_64), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <code>Dockerfile<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0430\u0448\u0435\u0433\u043e <code>Dockerfile<\/code> \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435. \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>FROM scratch<\/code>, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 rootfs \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># syntax=docker\/dockerfile:1.8\n\nARG OPENWRT_VERSION=23.05.5\nARG TARGET_ARCH=x86-64\n# \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 rootfs \u043e\u0442 OpenWrt\nARG ROOTFS_URL=https:\/\/downloads.openwrt.org\/releases\/${OPENWRT_VERSION}\/targets\/x86\/64\/openwrt-${OPENWRT_VERSION}-${TARGET_ARCH}-rootfs.tar.gz\n\nFROM scratch AS base\nARG ROOTFS_URL\n# \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 rootfs \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenWrt\nADD ${ROOTFS_URL} \/\n\nFROM base AS openwrt\n\nARG ROOT_PASSWORD=ChangeMe_Strong\nENV TZ=UTC\n\n# OpenWRT \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435\nRUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom \\\n &amp;&amp; cp -a \/etc \/rom\/ \\\n &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab\n\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438 Web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (LuCI)\nRUN opkg update \\\n &amp;&amp; opkg install --force-overwrite --force-space \\\n        luci-ssl \\\n        uhttpd \\\n        uhttpd-mod-ubus \\\n        dnsmasq \\\n        firewall4 \\\n        nftables \\\n        dropbear \\\n        ip-full \\\n        ca-bundle \\\n        openssl-util \\\n &amp;&amp; rm -rf \/var\/opkg-lists \/tmp\/*\n\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c root\nRUN echo \"root:${ROOT_PASSWORD}\" | chpasswd\n\n# \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0443\u0436\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\nRUN for s in boot network firewall dnsmasq dropbear uhttpd rpcd sysctl; do \\\n        if &#91; -x \"\/etc\/init.d\/$s\" ]; then \"\/etc\/init.d\/$s\" enable || true; fi; \\\n    done\n\nCOPY &lt;&lt;'EOF' \/entrypoint.sh\n#!\/bin\/sh\nset -e\n\n: \"${HOSTNAME:=openwrt}\"\n: \"${WAN_MAC:=02:42:c0:a8:00:c8}\"\n: \"${LAN_MAC:=02:42:c0:a8:c8:01}\"\n: \"${WAN_IP:=192.168.0.200}\"\n: \"${WAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_GATEWAY:=192.168.0.1}\"\n: \"${WAN_DNS:=192.168.0.1}\"\n: \"${LAN_IP:=192.168.200.1}\"\n: \"${LAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_WEB_ALLOW:=192.168.0.0\/24}\"\n\nif &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd\n    touch \/etc\/.docker_root_password_set\nfi\n\nhostname \"${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n\nnon_lo_ifs() {\n    ip -o link show 2&gt;\/dev\/null | awk -F': ' '{print $2}' | cut -d'@' -f1 | grep -E '^eth&#91;0-9]+$' || true\n}\n\ni=0\nwhile &#91; \"$i\" -lt 15 ]; do\n    cnt=$(non_lo_ifs | wc -l)\n    &#91; \"$cnt\" -ge 2 ] &amp;&amp; break\n    sleep 1\n    i=$((i+1))\ndone\n\nfind_if_by_mac() {\n    want=$(echo \"$1\" | tr 'A-F' 'a-f')\n    for p in \/sys\/class\/net\/*; do\n        n=\"${p##*\/}\"\n        &#91; \"$n\" = \"lo\" ] &amp;&amp; continue\n        mac=$(cat \"$p\/address\" 2&gt;\/dev\/null || true)\n        mac=$(echo \"$mac\" | tr 'A-F' 'a-f')\n        if &#91; -n \"$mac\" ] &amp;&amp; &#91; \"$mac\" = \"$want\" ]; then\n            echo \"$n\"\n            return 0\n        fi\n    done\n    return 1\n}\n\nWAN_IF=$(find_if_by_mac \"$WAN_MAC\" || true)\nLAN_IF=$(find_if_by_mac \"$LAN_MAC\" || true)\n\nif &#91; -z \"$WAN_IF\" ] || &#91; -z \"$LAN_IF\" ] || &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    set -- $(non_lo_ifs)\n    if &#91; -z \"$WAN_IF\" ]; then\n        WAN_IF=\"$1\"\n    fi\n    if &#91; -z \"$LAN_IF\" ] || &#91; \"$LAN_IF\" = \"$WAN_IF\" ]; then\n        shift 2&gt;\/dev\/null || true\n        LAN_IF=\"$1\"\n    fi\nfi\n\n: \"${WAN_IF:=eth0}\"\n: \"${LAN_IF:=eth1}\"\nif &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    LAN_IF=\"eth1\"\nfi\n\necho \"OpenWRT container: WAN=${WAN_IF}, LAN=${LAN_IF}\"\n\ncat &gt; \/etc\/config\/network &lt;&lt;NETWORK\nconfig interface 'loopback'\n    option device 'lo'\n    option proto 'static'\n    option ipaddr '127.0.0.1'\n    option netmask '255.0.0.0'\n\nconfig interface 'wan'\n    option device '${WAN_IF}'\n    option proto 'static'\n    option ipaddr '${WAN_IP}'\n    option netmask '${WAN_NETMASK}'\n    option gateway '${WAN_GATEWAY}'\n    list dns '${WAN_DNS}'\n    option defaultroute '1'\n\nconfig interface 'lan'\n    option device '${LAN_IF}'\n    option proto 'static'\n    option ipaddr '${LAN_IP}'\n    option netmask '${LAN_NETMASK}'\nNETWORK\n\nwhile ip route del default 2&gt;\/dev\/null; do :; done\n\nif &#91; -f \/etc\/config\/system ]; then\n    (\n        set +e\n        uci -q set system.@system&#91;0].hostname=\"${HOSTNAME}\"\n        uci commit system\n    )\nfi\n\nif &#91; -f \/etc\/config\/dhcp ]; then\n    (\n        set +e\n        uci -q set dhcp.lan=dhcp\n        uci set dhcp.lan.interface=lan\n        uci set dhcp.lan.start=100\n        uci set dhcp.lan.limit=150\n        uci set dhcp.lan.leasetime=12h\n\n        uci -q set dhcp.wan=dhcp\n        uci set dhcp.wan.interface=wan\n        uci set dhcp.wan.ignore=1\n\n        uci commit dhcp\n    )\nfi\n\nensure_web_rule() {\n    name=\"$1\"\n    port=\"$2\"\n\n    if ! uci -q get \"firewall.${name}\" &gt;\/dev\/null 2&gt;&amp;1; then\n        uci set \"firewall.${name}=rule\"\n    fi\n\n    uci set \"firewall.${name}.name=${name}\"\n    uci set \"firewall.${name}.src=wan\"\n    uci set \"firewall.${name}.proto=tcp\"\n    uci set \"firewall.${name}.dest_port=${port}\"\n    uci set \"firewall.${name}.target=ACCEPT\"\n\n    if &#91; -n \"${WAN_WEB_ALLOW}\" ]; then\n        uci set \"firewall.${name}.src_ip=${WAN_WEB_ALLOW}\"\n    else\n        uci -q delete \"firewall.${name}.src_ip\"\n    fi\n}\n\nif &#91; -f \/etc\/config\/firewall ]; then\n    (\n        set +e\n        ensure_web_rule allow_http_wan 80\n        ensure_web_rule allow_https_wan 443\n        uci commit firewall\n    )\nfi\n\nif &#91; ! -s \/etc\/uhttpd.crt ] || &#91; ! -s \/etc\/uhttpd.key ]; then\n    if command -v openssl &gt;\/dev\/null 2&gt;&amp;1; then\n        openssl req -x509 -newkey rsa:2048 -nodes -days 825 \\\n            -keyout \/etc\/uhttpd.key -out \/etc\/uhttpd.crt \\\n            -subj \"\/CN=${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n        chmod 600 \/etc\/uhttpd.key 2&gt;\/dev\/null || true\n    fi\nfi\n\nexec \/sbin\/init\nEOF\n\nRUN chmod +x \/entrypoint.sh\n\nEXPOSE 80 443\n\nENTRYPOINT &#91;\"\/entrypoint.sh\"]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <code>docker-compose.yml<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u043d\u0435\u0441\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0435\u043a\u0446\u0438\u044e <code>build.args<\/code>. \u0423\u0431\u0440\u0430\u043d \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 <code>OPENWRT_TAG<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d <code>OPENWRT_VERSION<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:\n  openwrt:\n    build:\n      context: .\n      args:\n        OPENWRT_VERSION: \"23.05.5\"\n        ROOT_PASSWORD: \"ChangeMe_Strong\"\n    image: openwrt-macvlan:23.05\n    container_name: openwrt\n    hostname: openwrt\n    restart: unless-stopped\n    stop_grace_period: 30s\n\n    privileged: true\n\n    environment:\n      TZ: \"UTC\"\n      HOSTNAME: \"openwrt\"\n\n      WAN_MAC: \"02:42:c0:a8:00:c8\"\n      LAN_MAC: \"02:42:c0:a8:c8:01\"\n\n      WAN_IP: \"192.168.0.200\"\n      WAN_NETMASK: \"255.255.255.0\"\n      WAN_GATEWAY: \"192.168.0.1\"\n      WAN_DNS: \"192.168.0.1\"\n\n      LAN_IP: \"192.168.200.1\"\n      LAN_NETMASK: \"255.255.255.0\"\n\n      WAN_WEB_ALLOW: \"192.168.0.0\/24\"\n\n    volumes:\n      - \/lib\/modules:\/lib\/modules:ro\n      - openwrt-etc:\/etc\n\n    sysctls:\n      - net.ipv4.ip_forward=1\n      - net.ipv4.conf.all.rp_filter=0\n      - net.ipv4.conf.default.rp_filter=0\n      - net.ipv4.conf.all.send_redirects=0\n      - net.ipv4.conf.default.send_redirects=0\n      - net.ipv4.conf.all.accept_redirects=0\n      - net.ipv4.conf.default.accept_redirects=0\n\n    networks:\n      wan:\n        ipv4_address: 192.168.0.200\n        mac_address: \"02:42:c0:a8:00:c8\"\n        priority: 1000\n      lan:\n        ipv4_address: 192.168.200.1\n        mac_address: \"02:42:c0:a8:c8:01\"\n        priority: 900\n\nnetworks:\n  wan:\n    driver: macvlan\n    driver_opts:\n      parent: enp6s0\n    enable_ipv6: false\n    ipam:\n      config:\n        - subnet: 192.168.0.0\/24\n          gateway: 192.168.0.1\n          ip_range: 192.168.0.200\/32\n\n  lan:\n    driver: macvlan\n    driver_opts:\n      parent: enp7s0\n    enable_ipv6: false\n    ipam:\n      config:\n        - subnet: 192.168.200.0\/24\n          gateway: 192.168.200.254\n          ip_range: 192.168.200.1\/32\n\nvolumes:\n  openwrt-etc:<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u041a\u0430\u043a \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 (\u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u044d\u0448\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0433 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u0441\u0435\u0442\u044c\ndocker compose down\n\n# 2. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0437, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u044d\u0448\ndocker compose build --no-cache --pull\n\n# 3. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c:<\/strong> \u041c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c \u043e\u0442 \u0442\u043e\u0433\u043e, \u0443\u0441\u043f\u0435\u043b\u0438 \u043b\u0438 \u043c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b OpenWrt \u0437\u0430\u043b\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0442\u0435\u0433 \u043d\u0430 Docker Hub. \u041c\u044b \u043a\u0430\u0447\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0441 <code>downloads.openwrt.org<\/code>.<\/li>\n\n\n\n<li><strong>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430:<\/strong> \u042f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 <code>x86-64<\/code> (\u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0430\u0448\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b <code>enp...<\/code> \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 x86_64 \u0441\u0435\u0440\u0432\u0435\u0440\/\u041f\u041a).<\/li>\n\n\n\n<li><strong>\u0427\u0438\u0441\u0442\u043e\u0442\u0430:<\/strong> \u041f\u0430\u043a\u0435\u0442\u044b \u0441\u0442\u0430\u0432\u044f\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0440\u0430\u0437\u0430, \u0430 \u043d\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0441\u0442\u0430\u0440\u0442.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">root@panel:\/opt\/openwrt# docker compose build &#8212;no-cache &#8212;pull<br>[+] Building 2.6s (8\/13) docker:default<br>=&gt; [openwrt internal] load build definition from Dockerfile 0.0s<br>=&gt; =&gt; transferring dockerfile: 5.63kB 0.0s<br>=&gt; [openwrt] resolve image config for docker-image:\/\/docker.io\/docker\/dockerfile:1.8 1.2s<br>=&gt; CACHED [openwrt] docker-image:\/\/docker.io\/docker\/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 0.0s<br>=&gt; [openwrt internal] load .dockerignore 0.0s<br>=&gt; =&gt; transferring context: 2B 0.0s<br>=&gt; [openwrt base 1\/1] ADD https:\/\/downloads.openwrt.org\/releases\/23.05.5\/targets\/x86\/64\/openwrt-23.05.5-x86-64-rootfs.tar.gz \/ 1.0s<br>=&gt; [openwrt internal] preparing inline document 0.0s<br>=&gt; [openwrt base 1\/1] ADD https:\/\/downloads.openwrt.org\/releases\/23.05.5\/targets\/x86\/64\/openwrt-23.05.5-x86-64-rootfs.tar.gz \/ 0.0s<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">=&gt; ERROR [openwrt openwrt 1\/6] RUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom &amp;&amp; cp -a \/etc \/rom\/ &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab 0.2s<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">[openwrt openwrt 1\/6] RUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom &amp;&amp; cp -a \/etc \/rom\/ &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">0.202 runc run failed: unable to start container process: exec: &#171;\/bin\/sh&#187;: stat \/bin\/sh: no such file or directory<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">failed to solve: process &#171;\/bin\/sh -c mkdir -p \/var\/lock \/var\/run \/tmp \/rom &amp;&amp; cp -a \/etc \/rom\/ &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab&#187; did not complete successfully: exit code: 1<br>root@panel:\/opt\/openwrt#<\/p>\n<\/blockquote>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0448\u0438\u0431\u043a\u0430 <code>exec: \"\/bin\/sh\": stat \/bin\/sh: no such file or directory<\/code> \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435: <strong>\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0430\u0440\u0445\u0438\u0432\u0435 rootfs OpenWrt \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <code>\/bin\/sh<\/code><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Docker \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>RUN<\/code> \u0447\u0435\u0440\u0435\u0437 <code>\/bin\/sh<\/code>. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 (Alpine, Ubuntu) <code>\/bin\/sh<\/code> \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043d\u043e \u0432 \u00ab\u0447\u0438\u0441\u0442\u043e\u043c\u00bb rootfs OpenWrt \u0435\u0433\u043e \u043d\u0435\u0442 \u2014 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <code>\/bin\/ash<\/code> (\u0438\u043b\u0438 \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438 \u043d\u0430 <code>busybox<\/code>). \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a Docker \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u0430.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>\/bin\/ash<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>\/bin\/sh<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0441\u0431\u043e\u0440\u043a\u0438. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 <code>SHELL<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <code>Dockerfile<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># syntax=docker\/dockerfile:1.8\n\nARG OPENWRT_VERSION=23.05.5\nARG TARGET_ARCH=x86-64\nARG ROOTFS_URL=https:\/\/downloads.openwrt.org\/releases\/${OPENWRT_VERSION}\/targets\/x86\/64\/openwrt-${OPENWRT_VERSION}-${TARGET_ARCH}-rootfs.tar.gz\n\nFROM scratch AS base\nARG ROOTFS_URL\n# \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 rootfs \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenWrt\nADD ${ROOTFS_URL} \/\n\nFROM base AS openwrt\n\nARG ROOT_PASSWORD=ChangeMe_Strong\nENV TZ=UTC\n\n# \u041a\u0420\u0418\u0422\u0418\u0427\u0415\u0421\u041a\u0418 \u0412\u0410\u0416\u041d\u041e: \u0412 OpenWrt rootfs \u043d\u0435\u0442 \/bin\/sh, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c shell \u043d\u0430 \/bin\/ash\nSHELL &#91;\"\/bin\/ash\", \"-c\"]\n\n# OpenWRT \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435\nRUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom \\\n &amp;&amp; cp -a \/etc \/rom\/ \\\n &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab\n\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438 Web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (LuCI)\nRUN opkg update \\\n &amp;&amp; opkg install --force-overwrite --force-space \\\n        luci-ssl \\\n        uhttpd \\\n        uhttpd-mod-ubus \\\n        dnsmasq \\\n        firewall4 \\\n        nftables \\\n        dropbear \\\n        ip-full \\\n        ca-bundle \\\n        openssl-util \\\n &amp;&amp; rm -rf \/var\/opkg-lists \/tmp\/*\n\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c root\nRUN echo \"root:${ROOT_PASSWORD}\" | chpasswd\n\n# \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0443\u0436\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\nRUN for s in boot network firewall dnsmasq dropbear uhttpd rpcd sysctl; do \\\n        if &#91; -x \"\/etc\/init.d\/$s\" ]; then \"\/etc\/init.d\/$s\" enable || true; fi; \\\n    done\n\nCOPY &lt;&lt;'EOF' \/entrypoint.sh\n#!\/bin\/sh\nset -e\n\n: \"${HOSTNAME:=openwrt}\"\n: \"${WAN_MAC:=02:42:c0:a8:00:c8}\"\n: \"${LAN_MAC:=02:42:c0:a8:c8:01}\"\n: \"${WAN_IP:=192.168.0.200}\"\n: \"${WAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_GATEWAY:=192.168.0.1}\"\n: \"${WAN_DNS:=192.168.0.1}\"\n: \"${LAN_IP:=192.168.200.1}\"\n: \"${LAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_WEB_ALLOW:=192.168.0.0\/24}\"\n\nif &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd\n    touch \/etc\/.docker_root_password_set\nfi\n\nhostname \"${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n\nnon_lo_ifs() {\n    ip -o link show 2&gt;\/dev\/null | awk -F': ' '{print $2}' | cut -d'@' -f1 | grep -E '^eth&#91;0-9]+$' || true\n}\n\ni=0\nwhile &#91; \"$i\" -lt 15 ]; do\n    cnt=$(non_lo_ifs | wc -l)\n    &#91; \"$cnt\" -ge 2 ] &amp;&amp; break\n    sleep 1\n    i=$((i+1))\ndone\n\nfind_if_by_mac() {\n    want=$(echo \"$1\" | tr 'A-F' 'a-f')\n    for p in \/sys\/class\/net\/*; do\n        n=\"${p##*\/}\"\n        &#91; \"$n\" = \"lo\" ] &amp;&amp; continue\n        mac=$(cat \"$p\/address\" 2&gt;\/dev\/null || true)\n        mac=$(echo \"$mac\" | tr 'A-F' 'a-f')\n        if &#91; -n \"$mac\" ] &amp;&amp; &#91; \"$mac\" = \"$want\" ]; then\n            echo \"$n\"\n            return 0\n        fi\n    done\n    return 1\n}\n\nWAN_IF=$(find_if_by_mac \"$WAN_MAC\" || true)\nLAN_IF=$(find_if_by_mac \"$LAN_MAC\" || true)\n\nif &#91; -z \"$WAN_IF\" ] || &#91; -z \"$LAN_IF\" ] || &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    set -- $(non_lo_ifs)\n    if &#91; -z \"$WAN_IF\" ]; then\n        WAN_IF=\"$1\"\n    fi\n    if &#91; -z \"$LAN_IF\" ] || &#91; \"$LAN_IF\" = \"$WAN_IF\" ]; then\n        shift 2&gt;\/dev\/null || true\n        LAN_IF=\"$1\"\n    fi\nfi\n\n: \"${WAN_IF:=eth0}\"\n: \"${LAN_IF:=eth1}\"\nif &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    LAN_IF=\"eth1\"\nfi\n\necho \"OpenWRT container: WAN=${WAN_IF}, LAN=${LAN_IF}\"\n\ncat &gt; \/etc\/config\/network &lt;&lt;NETWORK\nconfig interface 'loopback'\n    option device 'lo'\n    option proto 'static'\n    option ipaddr '127.0.0.1'\n    option netmask '255.0.0.0'\n\nconfig interface 'wan'\n    option device '${WAN_IF}'\n    option proto 'static'\n    option ipaddr '${WAN_IP}'\n    option netmask '${WAN_NETMASK}'\n    option gateway '${WAN_GATEWAY}'\n    list dns '${WAN_DNS}'\n    option defaultroute '1'\n\nconfig interface 'lan'\n    option device '${LAN_IF}'\n    option proto 'static'\n    option ipaddr '${LAN_IP}'\n    option netmask '${LAN_NETMASK}'\nNETWORK\n\nwhile ip route del default 2&gt;\/dev\/null; do :; done\n\nif &#91; -f \/etc\/config\/system ]; then\n    (\n        set +e\n        uci -q set system.@system&#91;0].hostname=\"${HOSTNAME}\"\n        uci commit system\n    )\nfi\n\nif &#91; -f \/etc\/config\/dhcp ]; then\n    (\n        set +e\n        uci -q set dhcp.lan=dhcp\n        uci set dhcp.lan.interface=lan\n        uci set dhcp.lan.start=100\n        uci set dhcp.lan.limit=150\n        uci set dhcp.lan.leasetime=12h\n\n        uci -q set dhcp.wan=dhcp\n        uci set dhcp.wan.interface=wan\n        uci set dhcp.wan.ignore=1\n\n        uci commit dhcp\n    )\nfi\n\nensure_web_rule() {\n    name=\"$1\"\n    port=\"$2\"\n\n    if ! uci -q get \"firewall.${name}\" &gt;\/dev\/null 2&gt;&amp;1; then\n        uci set \"firewall.${name}=rule\"\n    fi\n\n    uci set \"firewall.${name}.name=${name}\"\n    uci set \"firewall.${name}.src=wan\"\n    uci set \"firewall.${name}.proto=tcp\"\n    uci set \"firewall.${name}.dest_port=${port}\"\n    uci set \"firewall.${name}.target=ACCEPT\"\n\n    if &#91; -n \"${WAN_WEB_ALLOW}\" ]; then\n        uci set \"firewall.${name}.src_ip=${WAN_WEB_ALLOW}\"\n    else\n        uci -q delete \"firewall.${name}.src_ip\"\n    fi\n}\n\nif &#91; -f \/etc\/config\/firewall ]; then\n    (\n        set +e\n        ensure_web_rule allow_http_wan 80\n        ensure_web_rule allow_https_wan 443\n        uci commit firewall\n    )\nfi\n\nif &#91; ! -s \/etc\/uhttpd.crt ] || &#91; ! -s \/etc\/uhttpd.key ]; then\n    if command -v openssl &gt;\/dev\/null 2&gt;&amp;1; then\n        openssl req -x509 -newkey rsa:2048 -nodes -days 825 \\\n            -keyout \/etc\/uhttpd.key -out \/etc\/uhttpd.crt \\\n            -subj \"\/CN=${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n        chmod 600 \/etc\/uhttpd.key 2&gt;\/dev\/null || true\n    fi\nfi\n\nexec \/sbin\/init\nEOF\n\nRUN chmod +x \/entrypoint.sh\n\nEXPOSE 80 443\n\nENTRYPOINT &#91;\"\/entrypoint.sh\"]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 <code>SHELL [\"\/bin\/ash\", \"-c\"]<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>RUN<\/code> \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>\/bin\/ash<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u0432 \u0430\u0440\u0445\u0438\u0432\u0435.<\/li>\n\n\n\n<li>\u0423\u0431\u0440\u0430\u043d \u043b\u0438\u0448\u043d\u0438\u0439 <code>COPY<\/code> (\u0432\u0441\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>ADD<\/code>).<\/li>\n\n\n\n<li>\u0424\u0430\u0439\u043b <code>docker-compose.yml<\/code> \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u043a\u0438:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0443 \u0437\u0430\u043d\u043e\u0432\u043e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose build --no-cache\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0431\u043e\u0440\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c 1-3 \u043c\u0438\u043d\u0443\u0442\u044b, \u0442\u0430\u043a \u043a\u0430\u043a <code>opkg update &amp;&amp; opkg install<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b LuCI \u0438 firewall \u043f\u0440\u044f\u043c\u043e \u0432 \u043e\u0431\u0440\u0430\u0437. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442\u0441\u044f \u0441 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">root@panel:\/opt\/openwrt# docker compose build &#8212;no-cache<br>[+] Building 1.7s (8\/13) docker:default<br>=&gt; [openwrt internal] load build definition from Dockerfile 0.0s<br>=&gt; =&gt; transferring dockerfile: 5.71kB 0.0s<br>=&gt; [openwrt] resolve image config for docker-image:\/\/docker.io\/docker\/dockerfile:1.8 1.1s<br>=&gt; CACHED [openwrt] docker-image:\/\/docker.io\/docker\/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 0.0s<br>=&gt; [openwrt internal] load .dockerignore 0.0s<br>=&gt; =&gt; transferring context: 2B 0.0s<br>=&gt; CACHED [openwrt internal] preparing inline document 0.0s<br>=&gt; CACHED [openwrt base 1\/1] ADD https:\/\/downloads.openwrt.org\/releases\/23.05.5\/targets\/x86\/64\/openwrt-23.05.5-x86-64-rootfs.tar.gz \/ 0.3s<br>=&gt; [openwrt base 1\/1] ADD https:\/\/downloads.openwrt.org\/releases\/23.05.5\/targets\/x86\/64\/openwrt-23.05.5-x86-64-rootfs.tar.gz \/ 0.0s<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">=&gt; ERROR [openwrt openwrt 1\/6] RUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom &amp;&amp; cp -a \/etc \/rom\/ &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab 0.2s<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">[openwrt openwrt 1\/6] RUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom &amp;&amp; cp -a \/etc \/rom\/ &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">0.197 runc run failed: unable to start container process: exec: &#171;\/bin\/ash&#187;: stat \/bin\/ash: no such file or directory<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">failed to solve: process &#171;\/bin\/ash -c mkdir -p \/var\/lock \/var\/run \/tmp \/rom &amp;&amp; cp -a \/etc \/rom\/ &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab&#187; did not complete successfully: exit code: 1<br>root@panel:\/opt\/openwrt#<\/p>\n<\/blockquote>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0448\u0438\u0431\u043a\u0430 <code>stat \/bin\/ash: no such file or directory<\/code> \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 <strong>\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>ADD<\/code> \u0432 Docker<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>ADD<\/code> \u0441 <strong>URL-\u0430\u0434\u0440\u0435\u0441\u043e\u043c<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>ADD https:\/\/...\/rootfs.tar.gz \/<\/code>), Docker <strong>\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b, \u043d\u043e \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e<\/strong>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f \u043e\u0434\u0438\u043d \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0430 \u043d\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 OpenWrt. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438 <code>\/bin\/sh<\/code>, \u043d\u0438 <code>\/bin\/ash<\/code> \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438, \u0438 Docker \u043d\u0435 \u043c\u043e\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0438 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>RUN<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u041c\u043d\u043e\u0433\u043e\u044d\u0442\u0430\u043f\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 (Multi-stage Build)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Stage 1 (Alpine):<\/strong> \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u0440\u0445\u0438\u0432 \u043f\u043e URL \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 \u0447\u0438\u0441\u0442\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e. Alpine \u0442\u043e\u0447\u043d\u043e \u0438\u043c\u0435\u0435\u0442 <code>curl<\/code> \u0438 <code>tar<\/code>.<\/li>\n\n\n\n<li><strong>Stage 2 (Scratch):<\/strong> \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0443\u0436\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u0437 Alpine \u0432 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 <code>scratch<\/code>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <code>Dockerfile<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0430\u0448\u0435\u0433\u043e <code>Dockerfile<\/code> \u043d\u0430 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. \u041e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u0435\u043d \u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0442\u0435\u0433\u043e\u0432 \u043d\u0430 Docker Hub.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># syntax=docker\/dockerfile:1.8\n\nARG OPENWRT_VERSION=23.05.5\nARG TARGET_ARCH=x86-64\n# \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 rootfs\nARG ROOTFS_URL=https:\/\/downloads.openwrt.org\/releases\/${OPENWRT_VERSION}\/targets\/x86\/64\/openwrt-${OPENWRT_VERSION}-${TARGET_ARCH}-rootfs.tar.gz\n\n# --- \u042d\u0422\u0410\u041f 1: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 ---\nFROM alpine:3.19 AS downloader\nARG ROOTFS_URL\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c curl \u0438 tar, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \/rootfs\nRUN apk add --no-cache curl tar \\\n &amp;&amp; mkdir -p \/rootfs \\\n &amp;&amp; curl -sSL ${ROOTFS_URL} | tar -xz -C \/rootfs\n\n# --- \u042d\u0422\u0410\u041f 2: \u0421\u0431\u043e\u0440\u043a\u0430 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 ---\nFROM scratch AS base\n# \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u0437 \u044d\u0442\u0430\u043f\u0430 1\nCOPY --from=downloader \/rootfs \/\n\nFROM base AS openwrt\n\n# \u0412 OpenWrt \u043d\u0435\u0442 \/bin\/sh, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c shell \u0434\u043b\u044f \u0432\u0441\u0435\u0445 RUN \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \/bin\/ash\nSHELL &#91;\"\/bin\/ash\", \"-c\"]\n\nARG ROOT_PASSWORD=ChangeMe_Strong\nENV TZ=UTC\n\n# \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b OpenWrt \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435\nRUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom \\\n &amp;&amp; cp -a \/etc \/rom\/ \\\n &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab\n\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f Web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (LuCI) \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438\nRUN opkg update \\\n &amp;&amp; opkg install --force-overwrite --force-space \\\n        luci-ssl \\\n        uhttpd \\\n        uhttpd-mod-ubus \\\n        dnsmasq \\\n        firewall4 \\\n        nftables \\\n        dropbear \\\n        ip-full \\\n        ca-bundle \\\n        openssl-util \\\n &amp;&amp; rm -rf \/var\/opkg-lists \/tmp\/*\n\n# \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c root\nRUN echo \"root:${ROOT_PASSWORD}\" | chpasswd\n\n# \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\nRUN for s in boot network firewall dnsmasq dropbear uhttpd rpcd sysctl; do \\\n        if &#91; -x \"\/etc\/init.d\/$s\" ]; then \"\/etc\/init.d\/$s\" enable || true; fi; \\\n    done\n\n# Entrypoint-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0442\u0438 \u0438 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435\nCOPY &lt;&lt;'EOF' \/entrypoint.sh\n#!\/bin\/sh\nset -e\n\n: \"${HOSTNAME:=openwrt}\"\n: \"${WAN_MAC:=02:42:c0:a8:00:c8}\"\n: \"${LAN_MAC:=02:42:c0:a8:c8:01}\"\n: \"${WAN_IP:=192.168.0.200}\"\n: \"${WAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_GATEWAY:=192.168.0.1}\"\n: \"${WAN_DNS:=192.168.0.1}\"\n: \"${LAN_IP:=192.168.200.1}\"\n: \"${LAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_WEB_ALLOW:=192.168.0.0\/24}\"\n\nif &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd\n    touch \/etc\/.docker_root_password_set\nfi\n\nhostname \"${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n\nnon_lo_ifs() {\n    ip -o link show 2&gt;\/dev\/null | awk -F': ' '{print $2}' | cut -d'@' -f1 | grep -E '^eth&#91;0-9]+$' || true\n}\n\ni=0\nwhile &#91; \"$i\" -lt 15 ]; do\n    cnt=$(non_lo_ifs | wc -l)\n    &#91; \"$cnt\" -ge 2 ] &amp;&amp; break\n    sleep 1\n    i=$((i+1))\ndone\n\nfind_if_by_mac() {\n    want=$(echo \"$1\" | tr 'A-F' 'a-f')\n    for p in \/sys\/class\/net\/*; do\n        n=\"${p##*\/}\"\n        &#91; \"$n\" = \"lo\" ] &amp;&amp; continue\n        mac=$(cat \"$p\/address\" 2&gt;\/dev\/null || true)\n        mac=$(echo \"$mac\" | tr 'A-F' 'a-f')\n        if &#91; -n \"$mac\" ] &amp;&amp; &#91; \"$mac\" = \"$want\" ]; then\n            echo \"$n\"\n            return 0\n        fi\n    done\n    return 1\n}\n\nWAN_IF=$(find_if_by_mac \"$WAN_MAC\" || true)\nLAN_IF=$(find_if_by_mac \"$LAN_MAC\" || true)\n\nif &#91; -z \"$WAN_IF\" ] || &#91; -z \"$LAN_IF\" ] || &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    set -- $(non_lo_ifs)\n    if &#91; -z \"$WAN_IF\" ]; then\n        WAN_IF=\"$1\"\n    fi\n    if &#91; -z \"$LAN_IF\" ] || &#91; \"$LAN_IF\" = \"$WAN_IF\" ]; then\n        shift 2&gt;\/dev\/null || true\n        LAN_IF=\"$1\"\n    fi\nfi\n\n: \"${WAN_IF:=eth0}\"\n: \"${LAN_IF:=eth1}\"\nif &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    LAN_IF=\"eth1\"\nfi\n\necho \"OpenWRT container: WAN=${WAN_IF}, LAN=${LAN_IF}\"\n\ncat &gt; \/etc\/config\/network &lt;&lt;NETWORK\nconfig interface 'loopback'\n    option device 'lo'\n    option proto 'static'\n    option ipaddr '127.0.0.1'\n    option netmask '255.0.0.0'\n\nconfig interface 'wan'\n    option device '${WAN_IF}'\n    option proto 'static'\n    option ipaddr '${WAN_IP}'\n    option netmask '${WAN_NETMASK}'\n    option gateway '${WAN_GATEWAY}'\n    list dns '${WAN_DNS}'\n    option defaultroute '1'\n\nconfig interface 'lan'\n    option device '${LAN_IF}'\n    option proto 'static'\n    option ipaddr '${LAN_IP}'\n    option netmask '${LAN_NETMASK}'\nNETWORK\n\nwhile ip route del default 2&gt;\/dev\/null; do :; done\n\nif &#91; -f \/etc\/config\/system ]; then\n    (\n        set +e\n        uci -q set system.@system&#91;0].hostname=\"${HOSTNAME}\"\n        uci commit system\n    )\nfi\n\nif &#91; -f \/etc\/config\/dhcp ]; then\n    (\n        set +e\n        uci -q set dhcp.lan=dhcp\n        uci set dhcp.lan.interface=lan\n        uci set dhcp.lan.start=100\n        uci set dhcp.lan.limit=150\n        uci set dhcp.lan.leasetime=12h\n\n        uci -q set dhcp.wan=dhcp\n        uci set dhcp.wan.interface=wan\n        uci set dhcp.wan.ignore=1\n\n        uci commit dhcp\n    )\nfi\n\nensure_web_rule() {\n    name=\"$1\"\n    port=\"$2\"\n\n    if ! uci -q get \"firewall.${name}\" &gt;\/dev\/null 2&gt;&amp;1; then\n        uci set \"firewall.${name}=rule\"\n    fi\n\n    uci set \"firewall.${name}.name=${name}\"\n    uci set \"firewall.${name}.src=wan\"\n    uci set \"firewall.${name}.proto=tcp\"\n    uci set \"firewall.${name}.dest_port=${port}\"\n    uci set \"firewall.${name}.target=ACCEPT\"\n\n    if &#91; -n \"${WAN_WEB_ALLOW}\" ]; then\n        uci set \"firewall.${name}.src_ip=${WAN_WEB_ALLOW}\"\n    else\n        uci -q delete \"firewall.${name}.src_ip\"\n    fi\n}\n\nif &#91; -f \/etc\/config\/firewall ]; then\n    (\n        set +e\n        ensure_web_rule allow_http_wan 80\n        ensure_web_rule allow_https_wan 443\n        uci commit firewall\n    )\nfi\n\nif &#91; ! -s \/etc\/uhttpd.crt ] || &#91; ! -s \/etc\/uhttpd.key ]; then\n    if command -v openssl &gt;\/dev\/null 2&gt;&amp;1; then\n        openssl req -x509 -newkey rsa:2048 -nodes -days 825 \\\n            -keyout \/etc\/uhttpd.key -out \/etc\/uhttpd.crt \\\n            -subj \"\/CN=${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n        chmod 600 \/etc\/uhttpd.key 2&gt;\/dev\/null || true\n    fi\nfi\n\nexec \/sbin\/init\nEOF\n\nRUN chmod +x \/entrypoint.sh\n\nEXPOSE 80 443\n\nENTRYPOINT &#91;\"\/entrypoint.sh\"]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0424\u0430\u0439\u043b <code>docker-compose.yml<\/code> (\u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0435. \u041e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0435\u0440\u0435\u0434 \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0441\u043b\u043e\u0438 \u043a\u044d\u0448\u0430, \u0447\u0442\u043e\u0431\u044b Docker \u043d\u0435 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0442\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0441\u043b\u043e\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438 \u0441\u0435\u0442\u0438\ndocker compose down\n\n# 2. \u0423\u0434\u0430\u043b\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u0438 \u043a\u044d\u0448 \u0441\u0431\u043e\u0440\u043a\u0438\ndocker builder prune -af\n\n# 3. \u0421\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0437 \u0437\u0430\u043d\u043e\u0432\u043e \u0441 \u043d\u0443\u043b\u044f\ndocker compose build --no-cache\n\n# 4. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0431\u043e\u0440\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0439\u0442\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u042d\u0442\u0430\u043f <code>downloader<\/code> \u0441\u043a\u0430\u0447\u0430\u0435\u0442 \u0430\u0440\u0445\u0438\u0432, \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u0442 \u0435\u0433\u043e, \u0430 \u0437\u0430\u0442\u0435\u043c <code>opkg<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b (LuCI, firewall4, dropbear) \u043f\u0440\u044f\u043c\u043e \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0440\u0430\u0437\u0443 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c Web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">root@panel:\/opt\/openwrt# docker compose build &#8212;no-cache<br>[+] Building 5.2s (3\/3) FINISHED docker:default<br>=&gt; [openwrt internal] load build definition from Dockerfile 0.0s<br>=&gt; =&gt; transferring dockerfile: 4.27kB 0.0s<br>=&gt; [openwrt] resolve image config for docker-image:\/\/docker.io\/docker\/dockerfile:1.8 2.0s<br>=&gt; [openwrt] docker-image:\/\/docker.io\/docker\/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 3.1s<br>=&gt; =&gt; resolve docker.io\/docker\/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 0.0s<br>=&gt; =&gt; sha256:1d7e21b9eae3317824ebc8707e591a810a37dff6aff8e1d175f7d8c95a3aa532 12.09MB \/ 12.09MB 2.3s<br>=&gt; =&gt; sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd 8.40kB \/ 8.40kB 0.0s<br>=&gt; =&gt; sha256:dde28735fbb848299b7a43b7561d828b89c76f84f745c31896a7a7efbf93851a 482B \/ 482B 0.0s<br>=&gt; =&gt; sha256:265d11c3a0f3387fc23a28141d04918dae4cfa0b0ff311f958e05b23f772db95 1.26kB \/ 1.26kB 0.0s<br>=&gt; =&gt; extracting sha256:1d7e21b9eae3317824ebc8707e591a810a37dff6aff8e1d175f7d8c95a3aa532 0.7s<br>failed to solve: unterminated heredoc<br>root@panel:\/opt\/openwrt#<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0448\u0438\u0431\u043a\u0430 <code>failed to solve: unterminated heredoc<\/code> \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 \u0447\u0430\u0442\u0430 \u0432 <code>Dockerfile<\/code> \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0447\u0430\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0442\u0430\u0431\u0443\u043b\u044f\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u043c <code>EOF<\/code> (\u0438\u043b\u0438 <code>NETWORK<\/code>). \u041f\u0430\u0440\u0441\u0435\u0440 Dockerfile \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u043a\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0430\u043c\u044b\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0438 \u0447\u0438\u0441\u0442\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u2014 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 <strong>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/strong> \u0432 \u0432\u0430\u0448\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043e\u0431\u0440\u0430\u0437.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0432\u0430\u0448\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>\/opt\/openwrt<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>Dockerfile<\/code><\/li>\n\n\n\n<li><code>docker-compose.yml<\/code><\/li>\n\n\n\n<li><code>entrypoint.sh<\/code> (\u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b)<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>entrypoint.sh<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>entrypoint.sh<\/code> \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh\nset -e\n\n: \"${HOSTNAME:=openwrt}\"\n: \"${WAN_MAC:=02:42:c0:a8:00:c8}\"\n: \"${LAN_MAC:=02:42:c0:a8:c8:01}\"\n: \"${WAN_IP:=192.168.0.200}\"\n: \"${WAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_GATEWAY:=192.168.0.1}\"\n: \"${WAN_DNS:=192.168.0.1}\"\n: \"${LAN_IP:=192.168.200.1}\"\n: \"${LAN_NETMASK:=255.255.255.0}\"\n: \"${WAN_WEB_ALLOW:=192.168.0.0\/24}\"\n\nif &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd\n    touch \/etc\/.docker_root_password_set\nfi\n\nhostname \"${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n\nnon_lo_ifs() {\n    ip -o link show 2&gt;\/dev\/null | awk -F': ' '{print $2}' | cut -d'@' -f1 | grep -E '^eth&#91;0-9]+$' || true\n}\n\ni=0\nwhile &#91; \"$i\" -lt 15 ]; do\n    cnt=$(non_lo_ifs | wc -l)\n    &#91; \"$cnt\" -ge 2 ] &amp;&amp; break\n    sleep 1\n    i=$((i+1))\ndone\n\nfind_if_by_mac() {\n    want=$(echo \"$1\" | tr 'A-F' 'a-f')\n    for p in \/sys\/class\/net\/*; do\n        n=\"${p##*\/}\"\n        &#91; \"$n\" = \"lo\" ] &amp;&amp; continue\n        mac=$(cat \"$p\/address\" 2&gt;\/dev\/null || true)\n        mac=$(echo \"$mac\" | tr 'A-F' 'a-f')\n        if &#91; -n \"$mac\" ] &amp;&amp; &#91; \"$mac\" = \"$want\" ]; then\n            echo \"$n\"\n            return 0\n        fi\n    done\n    return 1\n}\n\nWAN_IF=$(find_if_by_mac \"$WAN_MAC\" || true)\nLAN_IF=$(find_if_by_mac \"$LAN_MAC\" || true)\n\nif &#91; -z \"$WAN_IF\" ] || &#91; -z \"$LAN_IF\" ] || &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    set -- $(non_lo_ifs)\n    if &#91; -z \"$WAN_IF\" ]; then\n        WAN_IF=\"$1\"\n    fi\n    if &#91; -z \"$LAN_IF\" ] || &#91; \"$LAN_IF\" = \"$WAN_IF\" ]; then\n        shift 2&gt;\/dev\/null || true\n        LAN_IF=\"$1\"\n    fi\nfi\n\n: \"${WAN_IF:=eth0}\"\n: \"${LAN_IF:=eth1}\"\nif &#91; \"$WAN_IF\" = \"$LAN_IF\" ]; then\n    LAN_IF=\"eth1\"\nfi\n\necho \"OpenWRT container: WAN=${WAN_IF}, LAN=${LAN_IF}\"\n\n# \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: heredoc \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 bash\/sh \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e,\n# \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 heredoc \u0432\u043d\u0443\u0442\u0440\u0438 Dockerfile\ncat &gt; \/etc\/config\/network &lt;&lt;NETWORK\nconfig interface 'loopback'\n    option device 'lo'\n    option proto 'static'\n    option ipaddr '127.0.0.1'\n    option netmask '255.0.0.0'\n\nconfig interface 'wan'\n    option device '${WAN_IF}'\n    option proto 'static'\n    option ipaddr '${WAN_IP}'\n    option netmask '${WAN_NETMASK}'\n    option gateway '${WAN_GATEWAY}'\n    list dns '${WAN_DNS}'\n    option defaultroute '1'\n\nconfig interface 'lan'\n    option device '${LAN_IF}'\n    option proto 'static'\n    option ipaddr '${LAN_IP}'\n    option netmask '${LAN_NETMASK}'\nNETWORK\n\nwhile ip route del default 2&gt;\/dev\/null; do :; done\n\nif &#91; -f \/etc\/config\/system ]; then\n    (\n        set +e\n        uci -q set system.@system&#91;0].hostname=\"${HOSTNAME}\"\n        uci commit system\n    )\nfi\n\nif &#91; -f \/etc\/config\/dhcp ]; then\n    (\n        set +e\n        uci -q set dhcp.lan=dhcp\n        uci set dhcp.lan.interface=lan\n        uci set dhcp.lan.start=100\n        uci set dhcp.lan.limit=150\n        uci set dhcp.lan.leasetime=12h\n\n        uci -q set dhcp.wan=dhcp\n        uci set dhcp.wan.interface=wan\n        uci set dhcp.wan.ignore=1\n\n        uci commit dhcp\n    )\nfi\n\nensure_web_rule() {\n    name=\"$1\"\n    port=\"$2\"\n\n    if ! uci -q get \"firewall.${name}\" &gt;\/dev\/null 2&gt;&amp;1; then\n        uci set \"firewall.${name}=rule\"\n    fi\n\n    uci set \"firewall.${name}.name=${name}\"\n    uci set \"firewall.${name}.src=wan\"\n    uci set \"firewall.${name}.proto=tcp\"\n    uci set \"firewall.${name}.dest_port=${port}\"\n    uci set \"firewall.${name}.target=ACCEPT\"\n\n    if &#91; -n \"${WAN_WEB_ALLOW}\" ]; then\n        uci set \"firewall.${name}.src_ip=${WAN_WEB_ALLOW}\"\n    else\n        uci -q delete \"firewall.${name}.src_ip\"\n    fi\n}\n\nif &#91; -f \/etc\/config\/firewall ]; then\n    (\n        set +e\n        ensure_web_rule allow_http_wan 80\n        ensure_web_rule allow_https_wan 443\n        uci commit firewall\n    )\nfi\n\nif &#91; ! -s \/etc\/uhttpd.crt ] || &#91; ! -s \/etc\/uhttpd.key ]; then\n    if command -v openssl &gt;\/dev\/null 2&gt;&amp;1; then\n        openssl req -x509 -newkey rsa:2048 -nodes -days 825 \\\n            -keyout \/etc\/uhttpd.key -out \/etc\/uhttpd.crt \\\n            -subj \"\/CN=${HOSTNAME}\" &gt;\/dev\/null 2&gt;&amp;1 || true\n        chmod 600 \/etc\/uhttpd.key 2&gt;\/dev\/null || true\n    fi\nfi\n\nexec \/sbin\/init<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 <code>Dockerfile<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0430\u0448 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <code>Dockerfile<\/code> \u043d\u0430 \u044d\u0442\u043e\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041c\u044b \u0443\u0431\u0440\u0430\u043b\u0438 \u0438\u0437 \u043d\u0435\u0433\u043e \u0432\u0435\u0441\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>COPY<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># syntax=docker\/dockerfile:1.8\n\nARG OPENWRT_VERSION=23.05.5\nARG TARGET_ARCH=x86-64\nARG ROOTFS_URL=https:\/\/downloads.openwrt.org\/releases\/${OPENWRT_VERSION}\/targets\/x86\/64\/openwrt-${OPENWRT_VERSION}-${TARGET_ARCH}-rootfs.tar.gz\n\n# --- \u042d\u0422\u0410\u041f 1: \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 ---\nFROM alpine:3.19 AS downloader\nARG ROOTFS_URL\nRUN apk add --no-cache curl tar \\\n &amp;&amp; mkdir -p \/rootfs \\\n &amp;&amp; curl -sSL ${ROOTFS_URL} | tar -xz -C \/rootfs\n\n# --- \u042d\u0422\u0410\u041f 2: \u0421\u0431\u043e\u0440\u043a\u0430 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 ---\nFROM scratch AS base\nCOPY --from=downloader \/rootfs \/\n\nFROM base AS openwrt\n\n# \u0412 OpenWrt \u043d\u0435\u0442 \/bin\/sh, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \/bin\/ash\nSHELL &#91;\"\/bin\/ash\", \"-c\"]\n\nARG ROOT_PASSWORD=ChangeMe_Strong\nENV TZ=UTC\n\nRUN mkdir -p \/var\/lock \/var\/run \/tmp \/rom \\\n &amp;&amp; cp -a \/etc \/rom\/ \\\n &amp;&amp; ln -sf \/proc\/mounts \/etc\/mtab\n\nRUN opkg update \\\n &amp;&amp; opkg install --force-overwrite --force-space \\\n        luci-ssl \\\n        uhttpd \\\n        uhttpd-mod-ubus \\\n        dnsmasq \\\n        firewall4 \\\n        nftables \\\n        dropbear \\\n        ip-full \\\n        ca-bundle \\\n        openssl-util \\\n &amp;&amp; rm -rf \/var\/opkg-lists \/tmp\/*\n\nRUN echo \"root:${ROOT_PASSWORD}\" | chpasswd\n\nRUN for s in boot network firewall dnsmasq dropbear uhttpd rpcd sysctl; do \\\n        if &#91; -x \"\/etc\/init.d\/$s\" ]; then \"\/etc\/init.d\/$s\" enable || true; fi; \\\n    done\n\n# \u041f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 \u0432 \u043e\u0431\u0440\u0430\u0437\nCOPY entrypoint.sh \/entrypoint.sh\nRUN chmod +x \/entrypoint.sh\n\nEXPOSE 80 443\n\nENTRYPOINT &#91;\"\/entrypoint.sh\"]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u043a\u0438<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 <code>\/opt\/openwrt<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Dockerfile<\/code><\/li>\n\n\n\n<li><code>docker-compose.yml<\/code><\/li>\n\n\n\n<li><code>entrypoint.sh<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0441\u0442\u0430\u0440\u0442:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u043a\u044d\u0448 \u0438 \u0441\u0442\u0430\u0440\u044b\u0435 \u0441\u043b\u043e\u0438\ndocker builder prune -af\n\n# \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c\ndocker compose build --no-cache\n\n# \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0448\u0438\u0431\u043a\u0430 <code>unterminated heredoc<\/code> \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a Docker \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <code>entrypoint.sh<\/code> \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u044c.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">3.810 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/luci\/Packages.sig<br>3.810 Signature check passed.<br>3.810 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/packages\/Packages.gz<br>3.810 Updated list of available packages in \/var\/opkg-lists\/openwrt_packages<br>3.810 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/packages\/Packages.sig<br>3.810 Signature check passed.<br>5.428 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/routing\/Packages.gz<br>5.428 Updated list of available packages in \/var\/opkg-lists\/openwrt_routing<br>5.428 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/routing\/Packages.sig<br>5.428 Signature check passed.<br>5.428 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/telephony\/Packages.gz<br>5.428 Updated list of available packages in \/var\/opkg-lists\/openwrt_telephony<br>5.428 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/telephony\/Packages.sig<br>5.428 Signature check passed.<br>5.736 Upgrading luci-ssl on root from git-23.035.26083-7550ad6 to git-25.222.75657-7ce34fe\u2026<br>7.654 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/luci\/luci-ssl_git-25.222.75657-7ce34fe_all.ipk<br>7.654 Package uhttpd (2023-06-25-34a8a74d-2) installed in root is up to date.<br>7.654 Package uhttpd-mod-ubus (2023-06-25-34a8a74d-2) installed in root is up to date.<br>7.654 Package dnsmasq (2.90-2) installed in root is up to date.<br>7.654 Package firewall4 (2023-09-01-598d9fbb-1) installed in root is up to date.<br>7.654 Package nftables-json (1.0.8-1) installed in root is up to date.<br>7.654 Package dropbear (2022.82-6) installed in root is up to date.<br>7.654 Installing ip-full (6.3.0-1) to root\u2026<br>7.654 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/ip-full_6.3.0-1_x86_64.ipk<br>7.654 Installing zlib (1.2.13-1) to root\u2026<br>7.654 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/zlib_1.2.13-1_x86_64.ipk<br>7.654 Installing libelf1 (0.189-1) to root\u2026<br>7.654 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/libelf1_0.189-1_x86_64.ipk<br>7.654 Installing libbpf1 (1.2.2-1) to root\u2026<br>7.654 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/libbpf1_1.2.2-1_x86_64.ipkGenerating engines.cnf<br>11.24 Generating providers.cnf<br>11.28<br>11.28 Upgrading ca-bundle on root from 20230311-1 to 20241223-1\u2026<br>11.28 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/ca-bundle_20241223-1_all.ipk<br>11.28 Installing openssl-util (3.0.16-1) to root\u2026<br>11.28 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/openssl-util_3.0.16-1_x86_64.ipk<br>11.28 Installing libopenssl3 (3.0.16-1) to root\u2026<br>11.28 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/libopenssl3_3.0.16-1_x86_64.ipk<br>11.28 Installing libopenssl-conf (3.0.16-1) to root\u2026<br>11.28 Downloading https:\/\/downloads.openwrt.org\/releases\/23.05.5\/packages\/x86_64\/base\/libopenssl-conf_3.0.16-1_x86_64.ipk<br>11.28 Configuring libopenssl3.<br>11.28 Configuring zlib.<br>11.28 Configuring libelf1.<br>11.28 Configuring libbpf1.<br>11.28 Configuring ip-full.<br>11.28 Configuring libopenssl-conf.<br>11.28 Configuring openssl-util.<br>11.28 Configuring luci-ssl.<br>11.28 Configuring ca-bundle.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">11.28 rm: can&#8217;t remove &#8216;\/tmp\/resolv.conf&#8217;: Resource busy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">failed to solve: process &#171;\/bin\/ash -c opkg update &amp;&amp; opkg install &#8212;force-overwrite &#8212;force-space luci-ssl uhttpd uhttpd-mod-ubus dnsmasq firewall4 nftables dropbear ip-full ca-bundle openssl-util &amp;&amp; rm -rf \/var\/opkg-lists \/tmp\/*&#187; did not complete successfully: exit code: 1<br>root@panel:\/opt\/openwrt#<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0448\u0438\u0431\u043a\u0430 <code>rm: can't remove '\/tmp\/resolv.conf': Resource busy<\/code> \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 OpenWrt \u0432 Docker.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 OpenWrt \u0444\u0430\u0439\u043b <code>\/etc\/resolv.conf<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u0441\u0438\u043c\u043b\u0438\u043d\u043a\u043e\u043c<\/strong> (\u0441\u0441\u044b\u043b\u043a\u043e\u0439) \u043d\u0430 <code>\/tmp\/resolv.conf<\/code>.<br>\u041a\u043e\u0433\u0434\u0430 Docker \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>opkg update<\/code>), \u043e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 DNS-\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0445\u043e\u0441\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043c\u043e\u0433 \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430. Docker \u0432\u0438\u0434\u0438\u0442 \u0441\u0438\u043c\u043b\u0438\u043d\u043a <code>\/etc\/resolv.conf<\/code> \u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b \u0441 DNS-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0445\u043e\u0441\u0442\u0430 <strong>\u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u0446\u0435\u043b\u0438 \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0430<\/strong> \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0432\u0435\u0440\u0445 <code>\/tmp\/resolv.conf<\/code>.<br>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 <code>\/tmp\/resolv.conf<\/code> \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u043e\u0439 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (mount point). \u041a\u043e\u0433\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>\/tmp\/<\/code> \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>rm -rf \/tmp\/*<\/code>, \u043e\u043d \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u043a\u0430\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u00abResource busy\u00bb) \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f <code>\/tmp\/*<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0438 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0438\u0441\u0447\u0435\u0437\u043d\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u0430\u0448 <code>Dockerfile<\/code> \u0438 \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u0431\u043b\u043e\u043a \u0441 <code>opkg install<\/code>. \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 (\u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 <code>|| true<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0435 \u043f\u0430\u0434\u0430\u043b\u0430 \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 <code>rm<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RUN opkg update \\\n &amp;&amp; opkg install --force-overwrite --force-space \\\n        luci-ssl \\\n        uhttpd \\\n        uhttpd-mod-ubus \\\n        dnsmasq \\\n        firewall4 \\\n        nftables \\\n        dropbear \\\n        ip-full \\\n        ca-bundle \\\n        openssl-util \\\n &amp;&amp; rm -rf \/var\/opkg-lists \\\n &amp;&amp; (rm -rf \/tmp\/* 2&gt;\/dev\/null || true)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0435\u0440\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435, Docker \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439. \u0412\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0437\u0430\u043d\u043e\u0432\u043e. \u041c\u043e\u0436\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>--no-cache<\/code> \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 (\u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u0430\u0440\u0445\u0438\u0432\u0430 \u0443\u0436\u0435 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e), \u043d\u043e \u0441\u0430\u043c <code>opkg<\/code> \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u0440\u0430\u0437:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose build<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0436\u0438\u0432 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u043f\u043e\u0434\u043d\u044f\u043b\u0438\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec -it openwrt ip -br addr<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">=> ERROR [openwrt openwrt 3\/6] RUN echo &#171;root:P@ssword2&#187; | chpasswd<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c <code>rootfs<\/code> OpenWrt <strong>\u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>chpasswd<\/code> \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442<\/strong> (\u043e\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 <code>shadow<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e). Docker \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0435\u0451 \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430\u0434\u0435\u0436\u043d\u043e \u0438 \u043d\u0435 \u0442\u044f\u043d\u0443\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u044d\u0448 \u043f\u0430\u0440\u043e\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>openssl<\/code> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435) \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0444\u0430\u0439\u043b <code>\/etc\/shadow<\/code> \u0447\u0435\u0440\u0435\u0437 <code>sed<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 <strong>\u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 <code>Dockerfile<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u0432\u0430\u0448\u0435\u043c <code>Dockerfile<\/code> \u0431\u043b\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c root\nRUN echo \"root:${ROOT_PASSWORD}\" | chpasswd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c root \u0447\u0435\u0440\u0435\u0437 openssl \u0438 sed (\u0442\u0430\u043a \u043a\u0430\u043a chpasswd \u043d\u0435\u0442 \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c rootfs)\nRUN HASH=$(openssl passwd -5 \"${ROOT_PASSWORD}\") &amp;&amp; \\\n    if grep -q '^root:' \/etc\/shadow; then \\\n        sed -i \"s|^root:&#91;^:]*:|root:${HASH}:|\" \/etc\/shadow; \\\n    else \\\n        echo \"root:${HASH}:19800:0:99999:7:::\" &gt;&gt; \/etc\/shadow; \\\n    fi<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 <code>entrypoint.sh<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0430\u043a\u0443\u044e \u0436\u0435 \u0437\u0430\u043c\u0435\u043d\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u043d\u0430\u0447\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 \u0442\u043e\u0439 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0443\u0436\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>entrypoint.sh<\/code>, \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    echo \"root:${ROOT_PASSWORD}\" | chpasswd\n    touch \/etc\/.docker_root_password_set\nfi<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if &#91; -n \"${ROOT_PASSWORD:-}\" ] &amp;&amp; &#91; ! -f \/etc\/.docker_root_password_set ]; then\n    HASH=$(openssl passwd -5 \"${ROOT_PASSWORD}\")\n    if grep -q '^root:' \/etc\/shadow; then\n        sed -i \"s|^root:&#91;^:]*:|root:${HASH}:|\" \/etc\/shadow\n    else\n        echo \"root:${HASH}:19800:0:99999:7:::\" &gt;&gt; \/etc\/shadow\n    fi\n    touch \/etc\/.docker_root_password_set\nfi<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u041f\u0435\u0440\u0435\u0441\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0437<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0443 \u0437\u0430\u043d\u043e\u0432\u043e. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u044b, Docker \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0435\u0441\u043b\u0438 \u043e\u043d \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f\ndocker compose down\n\n# \u041f\u0435\u0440\u0435\u0441\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\ndocker compose build\n\n# \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435\ndocker compose up -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u0432 Web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 OpenWrt (<code>http:\/\/192.168.0.200<\/code> \u0438\u043b\u0438 <code>http:\/\/192.168.200.1<\/code>) \u043f\u043e\u0434 \u043b\u043e\u0433\u0438\u043d\u043e\u043c <code>root<\/code> \u0438 \u0432\u0430\u0448\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u043c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 OpenWrt \u0432 Docker: \u0434\u0432\u0430 macvlan \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (WAN \u0438 LAN), \u0433\u043e\u0442\u043e\u0432\u044b\u0435 Dockerfile \u0438 docker-compose.yml, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 LuCI \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n","protected":false},"author":1,"featured_media":2248,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[540],"tags":[804,794,800,795,801,793,799,805,797,796,798,803,802],"class_list":["post-2244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-openwrt","tag-busybox-ash-docker","tag-docker-compose-openwrt","tag-dockerfile-openwrt","tag-macvlan-openwrt","tag-openwrt-dhcp-nat","tag-openwrt-docker","tag-openwrt-rootfs-docker","tag-openwrt--linux","tag-wan-lan-docker","tag---linux","tag--luci","tag---docker","tag--chpasswd-docker"],"_links":{"self":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts\/2244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2244"}],"version-history":[{"count":4,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts\/2244\/revisions"}],"predecessor-version":[{"id":2249,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts\/2244\/revisions\/2249"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/media\/2248"}],"wp:attachment":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}