podman-compose
podman-compose copied to clipboard
Set network properties for containers, per network individually.
Is your feature request related to a problem? Please describe. Yes. The current podman compose does not seem to support container network properties per network.
networks:
dhcp_macvlan:
mac: '6f:ee:c3:5a:87:70'
The mac address part of the above snippet is completely ignored by podman compose. According to the documentation, the syntax should be something like --net <network name>:ip=<IP address>,mac=<MAC address>
Describe the solution you'd like For podman compose to parse the network config ( more like container interface config? ) correctly and eventually to be able to produce correct podman command.
Describe alternatives you've considered Currently if I want to set MAC for any single network I'd have to manually do the podman command.
Additional context
Same issue here:
networks:
transit:
ipv4_address: 100.126.101.11
prod:
ipv4_address: 100.126.102.11
backup:
ipv4_address: 100.126.103.11
Which translates to:
podman create --name=vault-project_p1.osl.local_1 --label traefik.enable=true --label traefik.http.routers.p1_osl.rule=Host(`p1.osl.local`) --label io.podman.compose.config-hash=fa3dc42aea4a607d9da66c4591ad72db6a37853879bb8931cf59cdeca6a51c51 --label io.podman.compose.project=vault-project --label io.podman.compose.version=1.0.6 --label [email protected] --label com.docker.compose.project=vault-project --label com.docker.compose.project.working_dir=/home/n/git/vault-project --label com.docker.compose.project.config_files=compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=p1.osl.local --cap-add IPC_LOCK -e VAULT_ADDR=http://localhost:8200 -e VAULT_FORMAT=json -e VAULT_API_ADDR=http://0.0.0.0:8200 -e SKIP_CHOWN=True -v ./infra/config/prod:/vault/config/main:ro -v ./infra/config/_common:/vault/config/common:ro -v ./infra/files:/files:ro -v ./infra/working/p1.osl.local/:/working -v ./infra/working/p/:/token:ro --net vault-project_transit,vault-project_prod,vault-project_backup --network-alias p1.osl.local --ip=100.126.101.11 -p 8201 -p 8202 --hostname p1.osl.local hashicorp/vault:1.15.2 vault server -config=/vault/config/main -config=/vault/config/common
Error: --ip can only be set for a single network: invalid argument
Exact same issue as @N0K0 here:
networks:
traefiknet-private:
ipv4_address: ${TRAEFIK_PRIVATE_IP}
docker-proxy-network:
Which raises error :
Error: --ip can only be set for a single network: invalid argument
I have to manually run the podman create
command in which I set --net traefiknet-private:ip=<IP>
(instead of --net traefiknet-private --ip=<IP>
)
Hi @N0K0 @brainiac19, it looks like a fix has been merged into the main 3 days ago : See PR #867.