-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
mark explicitly published port as string to avoid user confusion #15375
Conversation
Signed-off-by: Guillaume Lours <[email protected]>
✅ Deploy Preview for docsdocker ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for docsdocker ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
Did that change? Because it definitely was an integer before; if integers are no longer accepted that is a big breaking change; https://github.com/docker/cli/blob/master/cli/compose/schema/data/config_schema_v3.9.json#L226 |
It changed in docker compose 2.3.0, see docker/compose#9306. |
@@ -54,7 +54,7 @@ services: | |||
ports: | |||
- mode: ingress | |||
target: 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why target
port is a number, but published
port is a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because you can use the range syntax to defined published ports as we already mentioned in the compose issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, target
cannot be a range, right? Thanks!
@thaJeztah introduced in compose-go with this PR, new versions of Compose can handle both, the issue comes when an older than |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milas, I have some questions about aligning compose file specification taking this PR into account, could you please take a look at this PR?
could |
I'm not totally sure that changing this example will help ease confusion. I think we should:
I think it's clear from the linked issue that, ignoring compatibility issues, users find the "single port as a string in |
Signed-off-by: Guillaume Lours [email protected]
Proposed changes
As string can be unquoted in Yaml, our example may confused user and let them assume that the
ports.published
attribut can be an integer.I explicitly wrapped the value with quotes to remove ambiguity
Related issues (optional)
docker/compose#9306