Open Reizake opened 2 years ago
what version of podman-compose are you using?
the external
part in networks mean you need to manage it yourself, you should create this network, see compose spec
here is an example how to specify static ip
version: "3"
networks:
app1_container_network:
ipam:
driver: default
config:
- subnet: "172.20.0.0/16"
services:
app1:
image: busybox
command: httpd -f -p 8080 -h /etc/
networks:
app1_container_network:
ipv4_address: 172.20.0.11
specifying address is against the 12 factor you should use port mapping not ip address mapping.
I am running:
['podman', '--version', '']
using podman version: 3.2.1
podman-composer version 1.0.3
podman --version
podman version 3.2.1
exit code: 0
just to confirm. this will still put it in the pre-existing network "podman" correct?
Either way when I set my compose file as such:
version: '3'
networks:
podman:
ipam:
driver: default
config:
- subnet: "10.88.2.0/24"
services:
app:
image: nextcloud
restart: always
volumes:
- ./nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=xxxx
- MYSQL_USER=xxxx
- MYSQL_HOST=xxxx
networks:
podman:
ipv4_address:10.88.2.10
db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=xxxx
- MYSQL_PASSWORD=xxxx
- MYSQL_DATABASE=xxxx
- MYSQL_USER=xxxx
networks:
podman:
ipv4_address:10.88.2.11
it still spits this error:
user@computer:/DAS/PodmanVolumes/nextcloud$ sudo podman-compose up -d
['podman', '--version', '']
using podman version: 3.2.1
Traceback (most recent call last):
File "/usr/local/bin/podman-compose", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/podman_compose.py", line 1775, in main
podman_compose.run()
File "/usr/local/lib/python3.9/dist-packages/podman_compose.py", line 1022, in run
self._parse_compose_file()
File "/usr/local/lib/python3.9/dist-packages/podman_compose.py", line 1128, in _parse_compose_file
raise RuntimeError(f"missing networks: {missing_nets_str}")
RuntimeError: missing networks: podman
would you please try latest branch.
pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz
I've tested it with equivalent yaml and it worked
---
version: "3"
networks:
podman:
ipam:
driver: default
config:
- subnet: "10.88.2.0/24"
services:
web1:
image: busybox
command: httpd -f -p 8080 -h /etc/
networks:
podman:
ipv4_address: 10.88.2.10
web2:
image: busybox
command: httpd -f -p 8080 -h /etc/
networks:
podman:
ipv4_address: 10.88.2.11
updating to the newest version fixed it. just for reference when wanting to use a pre-existing network you can ley it out as such:
networks:
podman:
external:
name: podman
services:
app:
image: nextcloud
restart: always
volumes:
- ./nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=xxxx
- MYSQL_DATABASE=xxxx
- MYSQL_USER=xxxx
- MYSQL_HOST=xxxx
networks:
podman:
ipv4_address: 10.88.2.10
db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=xxxx
- MYSQL_PASSWORD=xxxx
- MYSQL_DATABASE=xxxx
- MYSQL_USER=xxxx
networks:
podman:
ipv4_address: 10.88.2.11
I also notice it puts my containers in a pod now, which I like, but is there a command to stop that from happening in the compose file. or just a general way of setting pod configuration?
, but is there a command to stop that from happening in the compose file. or just a general way of setting pod configuration?
to prevent creating a pod
--no-pod disable pod creation
to adjust pod params
--pod-args pod_args disable pod creation
there is no way to control that from inside the yaml
Just a note that upgrading to podman-compose 1.0.4 fixed the same problem for me
there is no way to control that from inside the yaml Hm... but doing this
podman-compose up --no-pod
results in
unrecognized arguments: --no-pod
Do you have an example?
updating to the newest version fixed it.
For those finding this online and looking to backport a patch: the issue originally described here was #399, which was fixed with 4aa08cd0168de07641832d31b58b8f29eecfd059.
Any plan to do a new release?
@muayyad-alsadi is there any plan on the podman-compose 1.0.4 rpm release? Fedora 37 is still using the 1.0.3.
I'm facing the same issue with newer versions:
podman-compose --version
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 3.4.4
podman-compose version 1.0.6
podman --version
podman version 3.4.4
exit code: 0
podman-compose up
Error tearing down partially created network namespace for container c43...c48: CNI network "my_bridge" not found
The network itself was created and exists:
podman network ls
WARN[0000] Error validating CNI config file /etc/cni/net.d/my_bridge.conflist: [plugin bridge does not support config version "1.0.0" plugin portmap does not support config version "1.0.0" plugin firewall does not support config version "1.0.0" plugin tuning does not support config version "1.0.0"]
NETWORK ID NAME VERSION PLUGINS
2f259bab93aa podman 0.4.0 bridge,portmap,firewall,tuning
177b12cc34e2 my_bridge 1.0.0 bridge,portmap,firewall,tuning,dnsname
Edit: It only works when I use the preconfigured bridge network podman
.
networks:
my_bridge:
external:
name: podman
Having the exact same issue as @mreiche here. Any ideas??
Having the exact same issue as @mreiche here. Any ideas??
I use podman
network instead. So you could configure a network manually and reference it as external in your compose file.
I came back to this, because my problem seems to be related to Podman 3.4.4 on Ubuntu 22.04 and there is no official newer version available and I need to get this fixed. So this is my workaround.
When I created an external network, I saw a list with different versions.
podman network ls
NETWORK ID NAME VERSION PLUGINS
2f259bab93aa podman 0.4.0 bridge,portmap,firewall,tuning
8ac92e008a0e my_network 1.0.0 bridge,portmap,firewall,tuning,dnsname
and a suspicious message:
WARN[0000] Error validating CNI config file /etc/cni/net.d/my_network.conflist: [plugin bridge does not support config version "1.0.0" plugin portmap does not support config version "1.0.0" plugin firewall does not support config version "1.0.0" plugin tuning does not support config version "1.0.0"]
So I edited /etc/cni/net.d/my_network.conflist
and changed the version to 0.4.0
.
podman network ls
NETWORK ID NAME VERSION PLUGINS
2f259bab93aa podman 0.4.0 bridge,portmap,firewall,tuning
8ac92e008a0e my_network 0.4.0 bridge,portmap,firewall,tuning,dnsname
This network I could use with podman-compose
like:
networks:
default:
name: my_network
external: true
where also DNS resolution works now.
Is that a fix or a way to mute version compatibility warnings?
sob., 27 sty 2024, 20:09 użytkownik Mike Reiche @.***> napisał:
I came back to this, because my problem seems to be related to Podman 3.4.4 on Ubuntu 22.04, because there is no official newer version available and I need to get this fixed. So this is my workarround.
When I created an external network, I saw a list with different versions.
podman network ls NETWORK ID NAME VERSION PLUGINS 2f259bab93aa podman 0.4.0 bridge,portmap,firewall,tuning 8ac92e008a0e my_network 1.0.0 bridge,portmap,firewall,tuning,dnsname
and a suspicious message: ´´´ WARN[0000] Error validating CNI config file /etc/cni/net.d/my_network.conflist: [plugin bridge does not support config version "1.0.0" plugin portmap does not support config version "1.0.0" plugin firewall does not support config version "1.0.0" plugin tuning does not support config version "1.0.0"]
So I edited
/etc/cni/net.d/my_network.conflist
and changed the version to0.4.0
.podman network ls NETWORK ID NAME VERSION PLUGINS 2f259bab93aa podman 0.4.0 bridge,portmap,firewall,tuning 8ac92e008a0e my_network 0.4.0 bridge,portmap,firewall,tuning,dnsname This network I could use with podman-compose like: networks: default: name: my_network external: true´´´where also DNS resolution works now. — Reply to this email directly, view it on GitHub <https://github.com/containers/podman-compose/issues/463#issuecomment-1913298533>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB4DH6ZWOEM6G2H7LKZT37LYQVGGFAVCNFSM5R4QSO3KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRGMZDSOBVGMZQ> . You are receiving this because you commented.Message ID: ***@***.***>
It's a workaround.
I have the same issue on:
1.0.3-3
from Debian1.0.6-1~bpo12+1
from Debian1.0.7
from https://github.com/containers/podman-compose/archive/devel.tar.gzWeirdly, I only have this issue on the user account I specifically created for podman. On my user account on the same system, the same compose file just works. I nuked ~/.config/cni
& .local/share/containers
on both accounts at the start and checked before each test that the previous containers & networks were no longer listed by podman.
I also tried putting the podman account into the same groups as mine, without success. AFAIK those accounts have only a few differences where I could remotely imagine that those may could cause this issue.
I tested that with this simple compose file:
version: "2"
services:
test:
image: hello-world
When trying to make a static IP setting based specifically on this documentation under the "ipv4_address, ipv6_address" section: https://docs.docker.com/compose/compose-file/compose-file-v3/
I am receiving the "RuntimeError: missing networks: default,podman" error. I have tried a variety of other methods to no avail. it seems that podman-compose is not properly reading the networks: section in the yaml
here is my compose file:
And here are the results I get:
I have tried using default as well as "network_mode" neither gave good results. please let me know if there is any other info needed or things you would like me to try.