Open nathanleclaire opened 8 years ago
For docker-machine version 0.7.0, engine port is hardcoded at :
In my opinion, Docker engine port shouldn't be hardcoded anywhere but libmachine/engine/engine.go
as DefaultPort
.
Agree @tpires and let users to overwrite somehow (and storing it in config.json
).
I would be personally in favor of some --port
CLI general option.
I'm thinking of taking a stab at this. Would this be an option at the subcommand level (like create and provision), or at the docker-machine level?
I think at driver level.
I think you might be able to use a create
flag and use it passed in SetConfigFromFlags
e.g., flags.Int("engine-port")
(seems --generic-engine-port
already exists...), although I forget if we filter it out to only driver-specific flags before we pass it to that method.
provision
is a somewhat tricky though, since the drivers themselves don't really have a Provision
method, it's all external, so you wouldn't be able to do any tricks like edit config.json
and call provision
and expect it to work (granted, that's kind of an unsupported/unofficial workflow anyway).
I'm still learning the codebase, so bear with me, but it seems like only fake_provisioner
and the suse
provisioner have a hardcoded reference to the port. All the other ones use a dockerPort
variable.
I still have to see where that variable comes from, but I get the impression that in the provisioner everything has already been properly factored out (in most cases), so I'll just have to tackle the create subcommand.
The azure and generic driver already expose driver level flags for this functionality. How would you like me to handle that? Right now I've just removed these flags, but that could be considered a semver major change. I can also make these flags output a deprecated message. The final option is to leave them functional, but then the question becomes: how do they interact with the flag defined at subcommand level? Which flag takes precedence?
I'm personally leaning towards disabling them and have them output a deprecation warning, so people using them right now know what's going on. They can then be removed in a future version.
I've made a PR that implements this. I'm trying to rebase it against master as often as I can, but it would be nice if someone can take a look at it.
Bimonthly ping to see if anyone is actually interested in the PR.
@fsoppelsa @nathanleclaire is anyone interested in taking a look at the PR?
I am not maintainer anymore -- ping @shin-
In many various places (drivers, provisioning, etc.) engine port
:2376
is hardcoded. It should not be.