Replies: 3 comments
-
Could you plz assign this issue to me? I am glad to fix it. |
Beta Was this translation helpful? Give feedback.
-
Do we need to make allocation on server side(containerd) instead of client side(nerdctl)? I read some code snippet in Reference: no allocation in docker cli: allocation in moby Set If we make allocation on server side, PROSOther containerd client will support random ports feature as well. CONSIt will make containerd more complicated if it acts as a kubernetes container runtime. It is useless because https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#ports |
Beta Was this translation helpful? Give feedback.
-
Server-side implementation will take a time to reach consensus, so this should be on the client side |
Beta Was this translation helpful? Give feedback.
-
Description
The nerdctl will always use tcp port
49153
as a random port if hostport is not set when using-p/--publish
flag.Multiple rule will be created in iptable nat tables as well
Steps to reproduce the issue
Multiple containers
One container with multiple ports
compose
If multiple ports are defined without host ports in compose file, the same issue will occur.
Describe the results you received and expected
The auto-generated ports are available.
What version of nerdctl are you using?
$ nerdctl --version
nerdctl version 1.0.0
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
No response
Host information
$ sudo nerdctl info Client: Namespace: default Debug Mode: false Server: Server Version: 1.4.12 Storage Driver: overlayfs Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Log: fluentd journald json-file syslog Storage: aufs native overlayfs Security Options: apparmor seccomp Profile: default Kernel Version: 5.4.0-90-generic Operating System: Ubuntu 20.04.5 LTS OSType: linux Architecture: x86_64 CPUs: 8 Total Memory: 15.39GiB Name: build-ubuntu-01 ID: a2c61eb4-be6e-45d9-ba8e-a9933e17bf9a WARNING: No swap limit support
Beta Was this translation helpful? Give feedback.
All reactions