我已经准备好创建一个test
带有子网的网络10.2.5.0/16
,并且还为此 Compose 设置创建了一个 Pod test
。我无法找到定义 Pod 的方法。无论如何,当我尝试使用 docker-compose.yml 中的以下部分检查网络时
networks:
test:
ipv4_address: '10.2.5.2'
networks:
test:
driver: bridge
ipam:
driver: test
config:
- subnet: 10.2.5.0/16
我收到一个错误。
['podman', '--version', '']
using podman version: 4.3.1
Traceback (most recent call last):
File "/usr/bin/podman-compose", line 33, in <module>
sys.exit(load_entry_point('podman-compose==1.0.3', 'console_scripts', 'podman-compose')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/podman_compose.py", line 1775, in main
podman_compose.run()
File "/usr/lib/python3/dist-packages/podman_compose.py", line 1022, in run
self._parse_compose_file()
File "/usr/lib/python3/dist-packages/podman_compose.py", line 1128, in _parse_compose_file
raise RuntimeError(f"missing networks: {missing_nets_str}")
RuntimeError: missing networks: test
定义它们的正确方法是什么?