-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: docker-compose published port must be integer #459
fix: docker-compose published port must be integer #459
Conversation
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.
Could you please tell which version of docker, docker for mac, compose are you using?
@@ -661,14 +662,23 @@ func ParsePortConfig(value string) ([]ServicePortConfig, error) { | |||
return portConfigs, nil | |||
} | |||
|
|||
func convertPortRangeToPort(portRange string) uint32 { |
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 it your manual change or result of go mod tidy && go mod vendor
?
Adding some additional info (and solution) if it helps: This same issue started showing up when I upgraded my Nhost CLI from Mac BigSur, version: 11.6 (20G165) 🟢 Current stable state
🔴 Previous unstable state
🟢 Previous Stable state (outdated)
|
@benorudolf it will be included in the next release. I'll let you know once it's out |
@remaininlight @benorudolf the new release is out. Please check if the issue is still there |
@elephant3 Thank you 🙏 |
Description
Problem
When I run
nhost up
on macOS 12.3.1 I get this error:This seems to be caused by docker-compose changing their config (from >= 2.3) to require integers for the published port:
docker/compose#9306
Solution
All
published
ports generated for the docker-compose file are now generated as integers rather than stringsBecause
HostPort
(https://github.com/nhost/cli/compare/main...remaininlight:nhost-cli:fixed-docker-compose-published-port?expand=1#diff-02a255cf4e10d7bb679548ea0ba12fdd9e0babd0211db7561105e10d24ebe9d4L671) is a string which can be a range it is converted to an integer, taking the starting port from a range. I don't write Go very often, I'm sure there's room for improvement in that conversion function!Notes
Other notes that you want to share but do not fit into Problem or Solution.