Skip to content

[BUG] Expose Range Error response from daemon: invalid JSON: invalid port '<start>-<end>': invalid syntax #13378

Description

@tmknight

Description

Expose of port range results in invalid syntax. My first experience of this is with:
Docker version 29.0.0, build 3d4129b

Steps To Reproduce

  1. Docker version 29.0.0, build 3d4129b on Ubuntu 24.04.3 LTS

services:
test:
image: alpine
expose:
- "9091-9092"
docker compose -f ./text.xml run test
Error response from daemon: invalid JSON: invalid port '9091-9092: invalid syntax

Compose Version

Docker Compose version v2.40.3

Docker Environment

Client: Docker Engine - Community
Version: 29.0.0
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.30.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.40.3
Path: /usr/libexec/docker/cli-plugins/docker-compose
WARNING: Plugin "/usr/libexec/docker/cli-plugins/docker-compose_2-12-2" is not valid: plugin candidate "compose_2-12-2" did not match "^[a-z][a-z0-9]*$"
Server:
Containers: 21
Running: 21
Paused: 0
Stopped: 0
Images: 20
Server Version: 29.0.0
Storage Driver: zfs
Zpool: rpool
Zpool Health: ONLINE
Parent Dataset: rpool/ROOT/ubuntu_549uxf/var/lib
Space Used By Parent: 11773657088
Space Available: 138369679360
Parent Quota: no
Compression: lz4
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: fcd43222d6b07379a4be9786bda52438f0dd16a1
runc version: v1.3.3-0-gd842d771
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.8.0-87-generic
Operating System: Ubuntu 24.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 7.644GiB
Name: tmk-svr-01
ID: OVLQ:BHCM:EYES:2XNJ:IBFZ:ANTP:GEPH:Y5M7:FDET:EB5P:NOQB:G6VX
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: true
Firewall Backend: iptables

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions