Liviter Posted January 8 Share Posted January 8 version: '3.3' services: test: container_name: test restart: always ports: - '80:80' image: 'test/test:latest' networks: br0: ipv4_address: 192.168.50.231 networks: br0: external: true ipam: config: - subnet: 192.168.50.0/24 这样设置可以设置为静态IP,但是“网络”那一栏则变成了随机字符~ 请教一下各位,有更好的实现办法吗?先感谢各位 Quote Link to comment
Solution Liviter Posted January 11 Author Solution Share Posted January 11 已经自行解决~大家可以关注英文板块的相关帖子,找得到答案~ Quote Link to comment
JackieWu Posted January 11 Share Posted January 11 (edited) 给后面看到这个帖子的朋友: version: '3.8' services: qbittorrent: image: lscr.io/linuxserver/qbittorrent:latest container_name: qbittorrent networks: br0: ipv4_address: 192.168.1.99 networks: br0: external: true 如果需要让容器使用固定的 IP 地址,需要使用 ipv4_address 进行配置; br0 即 Unraid 上的桥接网络虚拟网卡设备,如果你有多个物理网卡都开启了桥接网络,那么你可以将其更改为 br1 、br2 或者 eth1 等虚拟网卡设备; 需要说明的是,使用这种方法安装的 docker ,在 Unraid 的 Docker 管理界面上,“网络”会显示为一串字符,该字符为 Docker 网络的网络 ID,如 #4 的朋友所示,此现象是由于 docker-compose 插件近段时间更新之后导致的(以前是正常显示网络名称的)。如果你用的是 6.12 版本,那么你可以参考下面 #6 楼朋友的解决办法进行解决; Edited February 10 by JackieWu Quote Link to comment
attentive-feat1829 Posted January 18 Share Posted January 18 On 1/11/2024 at 4:42 PM, JackieWu said: 给后面看到这个帖子的朋友: version: '3.8' services: qbittorrent: image: lscr.io/linuxserver/qbittorrent:latest container_name: qbittorrent networks: testnetwork: ipv4_address: 192.168.1.100 networks: testnetwork: external: true name: br0 testnetwork 是 docker-compose 里面一个自定义的网络,用于指向外部的网络。 当你需要给容器设定一个与 unraid 同网段的固定 IP 地址时,你需要将这个 testnetwork 指向 unraid 上的 br0 (或者其他的网络接口)。 将 testnetwork 指向外部网络接口的语法,在尾部的 network 元素中定义。 我按照这里的模板配置了docker,但是网络还是会显示和楼主类似的一串id,搜了下Reddit和unraid论坛英文版也没找到解决办法,想正常显示br0只能放弃compose吗 Quote Link to comment
JackieWu Posted January 19 Share Posted January 19 On 1/18/2024 at 10:39 AM, attentive-feat1829 said: 我按照这里的模板配置了docker,但是网络还是会显示和楼主类似的一串id,搜了下Reddit和unraid论坛英文版也没找到解决办法,想正常显示br0只能放弃compose吗 我对原文的回复进行了修改,你可以参考看看。 Quote Link to comment
Liviter Posted January 21 Author Share Posted January 21 (edited) On 1/18/2024 at 10:39 AM, attentive-feat1829 said: 我按照这里的模板配置了docker,但是网络还是会显示和楼主类似的一串id,搜了下Reddit和unraid论坛英文版也没找到解决办法,想正常显示br0只能放弃compose吗 这两个文件,丢入/usr/local/emhttp/plugins/dynamix.docker.manager/include目录下 更换文件风险自断 文件来源于论坛的 On 1/3/2024 at 11:42 AM, mtongnz said: I've been playing with the code behind this plugin and have made a couple of tweaks. I'd be interested on peoples thoughts and suggestions. The first allows you to specify any .env file. This allows use of a central env for all your compose files. https://github.com/dcflachs/compose_plugin/pull/24 Update the built in unRaid image versions so the GUI correctly shows updates for containers. I'm still testing this before doing a PR. https://github.com/dcflachs/compose_plugin/commit/4297b46fdfeaa077f405a328ee074606363d5f9b I've tweaked how the network info is shown in the GUI. It now shows all network names with the associated IP. This is in the dynamix.docker.manager plugin which is a core part of unRaid's GUI - so not technically part of this plugin. You need to set the label net.unraid.docker.managed: 'composeman' for this to work (this is usually done with the overide yaml). https://github.com/unraid/webgui/issues/1569 Here's a screenshot of it: I've contemplated making the network name bold but I don't think it's needed. At present, these all need to be implemented by overwriting the files in /usr/local/emhttp/plugins/. Look at the commits to see what files need to be edited. DockerClient.php DockerContainers.php Edited January 21 by Liviter 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.