-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose with podman doesn't support port range #15111
Comments
The error message is confusing but you are not using the correct syntax. |
@Luap99 No, I didn't specify a range "both sides". I want it to be fixed port 443 in container side, but a random port between 4430 to 4439 in the host. Please refer to the official document. The last example is: "12400-12500:1240" Which is exactly what I do in my example. Further more, the example is running well on docker. I uninstalled docker and installed podman to run it. Then the issue happened. |
This doesn't specify what exactly happens with this syntax. |
It means the inside(container) port is fix at 443 for other containers to access, but random port from 4430 to 4439 for outside(host). |
Yes, it pick one random from the given range as host port (from 4430 to 4439), and map it to the container port(443).
|
OK, I see that this also works with So the first step would be to add support to podman run -p and then we can enable it in the compat api. |
I'll take this |
Any progress with this? It is preventing me from running multiple replicas on a docker-compose stack: https://stackoverflow.com/questions/73773262/using-podman-with-docker-compose-how-to-get-multiple-replicas-of-a-service (or, is there any workaround to this issue) |
A friendly reminder that this issue had no activity for 30 days. |
@mheon What is going on here? |
No time to work on it. Waiting for a bug week. If anyone else wants this in the meantime, they can take it. |
In addition, it's worth mentioning that when using replicas, each service get the first open port(s) in the range. version: "3"
services:
invidious:
image: quay.io/invidious/invidious:latest
restart: unless-stopped
deploy:
mode: replicated
replicas: 7
endpoint_mode: vip
ports:
- "127.0.0.1:3000-3006:3000" The first invidious container gets mapped to |
I've also run into this issue attempting to run multiple syslog containers mapped to 514/udp in the container:
My goal is to spin up 10 containers in the Pod, and have them randomly be assigned a host port between 1514-1523, then mapped to 514/udp in the container itself. Is there any way to do this with a pod currently? |
Thanks for the feedback on the dupe ticket @Luap99. I see there isn't a simple fix, but I've got some time to be able to work on this issue. Is there a preferred method to fix it? |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I try to migrate my old project with docker/docker-compose to podman/docker-compose.
Everything works fine except the port range won't work.
I believe this bug is related to #12305 , which you already fix for EXPOSE, but not for ports.
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes. I download the latest version from here #14065 (comment)
I also check the troubleshooting page, nothing is useful for the port range bug.
Additional environment details (AWS, VirtualBox, physical, etc.):
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
The text was updated successfully, but these errors were encountered: