-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
podman: adding dynamic port binding using slirp4netns
API socket
#2503
Comments
Sorry, I can't help you on this, but could you share your Python script? This might be interesting to a huge amount of users. I didn't find it in your repository :( Update, I can verify this (and the workaround) for this built
|
I don't know if we want to do this dynamically (it might work for rootless, but wouldn't work when running as root, and I'd prefer not to let the two diverge too much), so I would prefer to make this require a pod restart (to pick up requested port mappings from other containers in the pod) - would that be unacceptable? |
@mheon yes I agree. We could probably do it for slirp4netns by contacting the socket API but I don't think it is a good idea to diverge from other kind of networks. |
sure, here it's: muayyad-alsadi/podman-compose.
we can publish ports per container or per pod, I have too modes, I only need one of them to work |
what I did as rootless is:
and it works, I could connect to the port assigned to the pod. Doesn't that work for you? |
@giuseppe we need to run multiple containers on same pod, let's say two containers one is busybox what I want is to be able to call redis from inside busybox and busybox from redis (inter-container communication), and I need aliases in /etc/hosts for them
and from inside redis, let's call busybox
|
@giuseppe please note it seems that the default in
|
That's indicating containers in the pod will share a network namespace with
each other, not with the host.
…On Tue, Mar 5, 2019, 05:36 Muayyad Alsadi ***@***.***> wrote:
@giuseppe <https://github.com/giuseppe> please note it seems that the
default in podman pod create is to share network with host
$ podman pod create --help
...
--share string A comma delimited list of kernel namespaces the pod will share (default "cgroup,ipc,net,uts")
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2503 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHYHCM808ZT9PXlwXIF-kIJundH-Qvdwks5vTki8gaJpZM4ba_X0>
.
|
they share the same network namespace, doesn't |
More than that - they're sharing a network namespace, so they all share a single IP. There's no need for hosts entries? |
yes, but I want to run |
I tried both the defaults and many combinations and nothing worked. |
@muayyad-alsadi Did you have success on this in the meanwhile? |
yes, I've two working ways, one of them the other working one is |
@muayyad-alsadi Very nice, I'll test them soon! |
@tobwen @muayyad-alsadi What is the latest on this. Can I close this issue? |
@rhatdan I don't know, In |
@giuseppe @AkihiroSuda WDYT? |
I think we can close the issue. Dynamic port binding is out of the scope for Podman (even if it is possible in slirp4netns) |
I'm using
podman
version 1.1.0, and I'm writing a python script to rundocker-compose.yml
by creating a pod and launching containers inside it and connect them via--add-host
the following did not work
on the other hand the following works fine
I found the following workaround
The text was updated successfully, but these errors were encountered: