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

Allow published binding port to be string #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

celiolatorraca
Copy link

@celiolatorraca celiolatorraca commented May 23, 2022

Since docker compose version 2.3.x, the default behavior now is to return the published binding port as string, which breaks the dockest validation.

This PR fixes the issue #300

docker/compose#9306

@netlify
Copy link

netlify bot commented May 23, 2022

Deploy Preview for dockest canceled.

Name Link
🔨 Latest commit 58d0b79
🔍 Latest deploy log https://app.netlify.com/sites/dockest/deploys/628bb4acdc9a080008b20c09

@erikengervall
Copy link
Owner

realmvp

@erikengervall erikengervall self-requested a review May 23, 2022 16:35
@celiolatorraca
Copy link
Author

@erikengervall Should we convert the string ports to number when validating?

I noticed that we expect the ports to be number in a few places afterwards...

@erikengervall
Copy link
Owner

erikengervall commented May 23, 2022

@erikengervall Should we convert the string ports to number when validating?

I noticed that we expect the ports to be number in a few places afterwards...

Good question...

Kinda want to roll forward and make a note that one has to upgrade docker compose if they wish to use the upcoming version, rather than making it backwards compatible

WDYT?

@celiolatorraca
Copy link
Author

@erikengervall Should we convert the string ports to number when validating?
I noticed that we expect the ports to be number in a few places afterwards...

Good question...

Kinda want to roll forward and make a note that one has to upgrade docker compose if they wish to use the upcoming version, rather than making it backwards compatible

WDYT?

Well! Sounds also good

The only problem is that we may still need to parse the string to integer at some point.
Libs like net require the port to be number and not string

If we choose the "roll forward" approach, we would need just to bump a major version and make it clear somehow that the new version requires docker compose 2.3.x and the older versions should be used if version is lower than that

@emrahyldrm
Copy link

Hello guys,
Do you have any updates on this?

@erikengervall
Copy link
Owner

@erikengervall Should we convert the string ports to number when validating?
I noticed that we expect the ports to be number in a few places afterwards...

Good question...
Kinda want to roll forward and make a note that one has to upgrade docker compose if they wish to use the upcoming version, rather than making it backwards compatible
WDYT?

Well! Sounds also good

The only problem is that we may still need to parse the string to integer at some point. Libs like net require the port to be number and not string

If we choose the "roll forward" approach, we would need just to bump a major version and make it clear somehow that the new version requires docker compose 2.3.x and the older versions should be used if version is lower than that

I'm fine with a major bump with this restriction 🙂

Hello guys,
Do you have any updates on this?

@emrahyldrm apologies, haven't had the time to sit down and flesh out the code for the above suggestions.


I'd be happy to review a PR containing upgrades to docker compose 2.3.x and do a major bump!

@rperryng
Copy link

rperryng commented Aug 10, 2022

Has there been an official response from the docker team to confirm what the desired behaviour should be?

According to their example in their own docs about specifying ports, the value is a number (even though the docker compose config output is currently giving a string).

If it is a bug on their end, would dockest then have to add another major breaking change if they decide to use numbers again in the docker compose config 😅 ?

I wrote a small proof of concept (before I saw this thread, oops!) that normalizes the published field into a number always. Could this be a viable approach to ship as a non-breaking change? Let me know how I could help, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants