Skip to content

[Bug]: Cannot publish same port with both TCP and UDP #992

@andreyrd

Description

@andreyrd

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

Try to publish the same port number on UDP and TCP using, for example: -p 53:53/udp -p 53:53/tcp.

Current behavior

Refuses to start. Get the error shown in the log section below.

Expected behavior

It should allow forwarding TCP and UDP on the same port number. This is supported in Docker, Podman, etc and even by the underlying container backend it seems. I think it's just the validation done here that needs to account for the protocol as well. I fixed this locally myself and tested, but I haven't touched Swift in years so my approach was pretty ugly, I changed the Set to be strings and just shoved the protocol and port into a string. This is where Swift tuples with Hashable members being Hashable would really come in handy.

Environment

- OS: 26.2 (25C56)
- Xcode: 26.2 (17C52)
- Container: 0.7.1

Relevant log output

Error: invalidArgument: "host ports for different publish port specs may not overlap"

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions