When creating a container via dockers api, you can provide a range of ports for the host port. Docker will bind a port from this range that has not already been allocated. The range is specified with a dash e.g. 8080-8090
Calling the podman API with a range in this way results in an error.
The same can be seen calling the create subcommands. e.g. docker create -p 8080-8090:80 alpine sleep 100
Steps to reproduce the issue
Steps to reproduce the issue
Run docker create -p 8080-8090:80 alpine sleep 100 on a system with docker installed and see it is accepted. The container can then be started
Run docker create -p 8080-8090:80 alpine sleep 100 on a system with podman installed and see the error
Describe the results you received
Error response from daemon: make cli opts(): strconv.Atoi: parsing "8080-8090": invalid syntax
Issue Description
When creating a container via dockers api, you can provide a range of ports for the host port. Docker will bind a port from this range that has not already been allocated. The range is specified with a dash e.g.
8080-8090
Calling the podman API with a range in this way results in an error.
The same can be seen calling the
create
subcommands. e.g.docker create -p 8080-8090:80 alpine sleep 100
Steps to reproduce the issue
Steps to reproduce the issue
docker create -p 8080-8090:80 alpine sleep 100
on a system with docker installed and see it is accepted. The container can then be starteddocker create -p 8080-8090:80 alpine sleep 100
on a system with podman installed and see the errorDescribe the results you received
Error response from daemon: make cli opts(): strconv.Atoi: parsing "8080-8090": invalid syntax
Which appears to originate from: https://github.com/containers/podman/blob/bd00c6fef9b8dce1784fd531a8f3037eafb69008/pkg/api/handlers/compat/containers_create.go#L263
Describe the results you expected
No error returned and the container created with a port from the provided range allocated
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
I've tested this in podman 5.0.2 on linux on an EC2 instance I've also attempted it on podman desktop on mac against 5.1.1
Additional information
I have time to contribute a PR for this issue. Any advice about how best to solve this would be appreciated