Skip to content
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

want ports long syntax support species IP address like short syntax #6753

Closed
Sherlock-Holo opened this issue Jun 15, 2019 · 5 comments
Closed

Comments

@Sherlock-Holo
Copy link

I write a docker-compose.yml and use ports with long syntax to expose services, like

ports:
      - target: 53
        published: 127.0.0.1:53
        protocol: udp

      - target: 9253
        published: 127.0.0.1:9253
        protocol: tcp

when I run docker-compose config it will report Error while attempting to convert service.dns.ports.published to appropriate type: "127.0.0.1:53" is not a valid integer

If long syntax support sepices IP address, it will be great

@chris-crone
Copy link
Member

Hi @Sherlock-Holo,

Thanks for the report. You are right that you currently cannot do this with the long port format. A couple of things raised by @thaJeztah about this:

  • It would not work in orchestrated environments (i.e.: Swarm or Kubernetes)
  • It would require a new field in the port spec

@imfms
Copy link

imfms commented Aug 19, 2019

@chris-crone

The long syntax can use extension-fields directly.
If long syntax support sepices IP address, it will be great.

x-config:
- &publish-port "127.0.0.1:80"

...
ports:
  - target: 80
    published: *publish-port

Although Swarm or Kubernetes don't support, but short syntax was also. It's not a problem~

@thaJeztah
Copy link
Member

It would not work in orchestrated environments (i.e.: Swarm or Kubernetes)

There's a tracking issue for features that are not currently supported for swarm-mode / orchestrated environments here: moby/moby#25303

And two issues about supporting ip-address when publishing ports (moby/moby#26696, moby/moby#32299)

It would require a new field in the port spec

Yes, so apart from the above, this would also need some design choices, with things to consider about:

  • would it only support ip-addresses, or also (e.g.) interface name (eth0) ?
  • If both IPv6 and IPv4 is to be supported; a single field or multiple?
  • (related to the previous); can it hold a single address, or multiple? (or should the format "keep it simple") and require multiple ports to be specified - one for each ip-address for a port-mapping?

Using an extension field (x-something) that's only supported by docker compose, and marking it "experimental" could be used to explore what works best.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 17, 2022
@stale
Copy link

stale bot commented Apr 25, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants