Hi there!
As mentioned in the Docker documentation, I’m trying to expose a range of around 300 ports. However, the result I get is just 0/tcp
.
Is this a bug, or am I doing something wrong? I’ve been racking my brain over this .
I’ve tried multiple configurations, but I keep getting the same result.
Any help would be greatly appreciated!
Thanks!
Docker Compose version v2.29.1
On Debian or windows
Compose File
services:
hello_world:
image: debian
expose:
- 58787-59000
command:
- /bin/bash
- -c
- |
while [ 1 ]; do echo " hello world !" ;sleep 30 ;done;
When i run
sudo docker compose up -d --build
EXPECTED
debian "/bin/bash -c 'while…" 3 minutes ago Up 3 minutes 58787-5900/tcp
...
"Config": {
"Hostname": "3f9dea0b4aa7",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"58787-59000": {}
…
"NetworkSettings": {
"Bridge": "",
"SandboxID": "*****************************",
"SandboxKey": "/var/run/docker/netns/**************",
"Ports": {
"58787-59000/tcp"
RESULT
debian "/bin/bash -c 'while…" 7 seconds ago Up 6 seconds 0/tcp
...
"Config": {
"Hostname": "3f9dea0b4aa7",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"58787-59000": {}
…
"NetworkSettings": {
"Bridge": "",
"SandboxID": "*****************************",
"SandboxKey": "/var/run/docker/netns/**************",
"Ports": {
"0/tcp": null