containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.09k stars 483 forks source link

Containers require unique internal port #224

Open m-czernek opened 4 years ago

m-czernek commented 4 years ago

The following docker-compose.yml file is a valid file for docker-compose:

version: '3.8'
services:
  redis:
    image: "redis:alpine"
  redis-2:
    image: "redis:alpine"

Both containers become available and ready. No ports are exposed to the outside.

However, podman-compose fails to properly execute the above configuration because redis and redis-2 require identical ports.

The following configuration encounters the same problem:

version: '3.8'
services:
  redis:
    image: "redis:alpine"
    deploy:
      replicas: 2

Containers should be internally isolated from each other, and should not require unique internal ports.

nikAizuddin commented 4 years ago

I think you have to disable mappings by adding --transform_policy=identity. For example:

$ sudo podman-compose --transform_policy=identity up

Here a list of available mappings for --transform_policy.

muayyad-alsadi commented 4 years ago

This might be possible now

https://github.com/containers/podman/pull/7460