-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Proposal: Override ApiVersion in client #11486
Comments
See #7746 which has discussion on this subject. |
👍 |
👍 would make it easier to use the latest docker client with boot2docker definitely. Btw: is there some SemVer for docker protocol versions? Any notion of forwards or backwards compatibility? Or will it just be luck in the end ;-) |
@tknerr current status is: clients (API version: |
@ahmetalpbalkan ok understand, so that's why there should probably be a big DANGER sign when using Is there any notion of |
@tknerr Well, I assume 2.x would be a breaking change, that's why we have API v1.19 now. :) But I'm not sure if there's any promises around this. |
This is what I get with latest docker client 1.5.0-dev, build 7ecf4e5 (1.19) + boot2docker 1.5.0 (1.17):
Then on
Not sure if this is a protocol incompatibility here or something gone wrong with |
If the latter |
@tknerr you should almost never edit a binary like that. :) just edit |
@ahmetalpbalkan 100% agree. Just heard some success from @StefanScherer with that and thought it would be faster to try... ;-) |
So I need docker to build docker? That's consequent... |
@tknerr officially, yes. Unofficially, if you want to build just the client binary, you just need the Go compiler ( see this guide –you need to slightly change for OS X/Linux obviously). That's the solution I recommend to my colleagues to get around this problem. |
thanks @ahmetalpbalkan! |
@ahmetalpbalkan worked like a charm, thanks! Concerning the name/value of the env var, do you want the user to give a specific version? Or should it rather be something like |
...or akin to |
@tknerr verification is not done on client side, it's done on server side (e.g. client calls |
I've just tested the latest The better way at the moment without compiling and patching docker.exe and just have a test environment for playing with Start the dev machine, check its IP address and SSH into the VM as described in https://github.com/boot2docker/boot2docker#ssh-into-vm
I've tested it on my Mac with this little helper VM ( https://github.com/StefanScherer/docker-windows-box ) I've built today
If docker 1.6 is realease there will be an updated boot2docker ISO as well. |
@ahmetalpbalkan makes sense, thanks for explaining Btw: I'm coming quite close with the help of your guide, but what makes some problems is that
Running
Is there anyting else I need to do other than |
@tknerr that's expected when you're building outside of a container (unofficial build). |
Also please let's keep "how can I get this working" questions out of this issue. This is a proposal for an implementation and we should discuss if we need that or not. 😄 |
@ahmetalpbalkan yep you are right, and thanks for your help! So as already stated I'm totally 👍 fo the env var. |
Perhaps the client should automatically switch back to the older API if it's detected (and, possibly a flag/env-var specified). Thinking of cases where a single client is used to manage multiple hosts. Some hosts are up-to-date, others use an older daemon. Having to change the |
@thaJeztah having that sort of logic is probably 100x harder to code and maintain. Users should almost never know about this environment variable, this is for the power users and is just an override. Please refer back to the proposal above. |
Any ETA of when this will be available? |
+1 for the ETA question |
We recently added |
#dibs |
here ya go: #15964 |
lol didn't realize I should've just done it, I was waiting for some approval I guess. @duglin thanks for taking this up. |
@ahmetalpbalkan PRs usually work best (if you're willing to take the risk of it being rejected)...the maintainers are keen on getting the number of open PRs down 😉 😇 🙊 |
@ahmetalpbalkan @duglin It feels like the solution would be to not have that stupid restriction and be smarter about API versioning. In fact I believe @calavera is working on the API (feel free to chime in). Now for the immediate pain, I would NOT recommend supporting this in any way, except for docker devs, so I would be fine with an unsupported and undocumented envvar, and only an envvar. That way we can break it whenever we want. |
@tiborvass not sure how any of the API versioning stuff would fix/help here since we're talking about allowing the user to set the version string to something different than what the CLI wants to use. re: docs - I'm not going to demand that it be in the docs, but I'm not a fan of hiding stuff - having an advanced section is ok though. Hiding stuff got msft in trouble many moons ago :-) |
I understand the use case in a dev environment, but I'm afraid people will start using this for bad reasons. Instead of overriding the ApiVersion, can we make it some sort of "dev mode" that bypasses the check entirely? Or as @crosbymichael is suggested: make this dependent on |
I think @ahmetalpbalkan was looking for more than just turning off the check on the daemon but to also have the CLI change the URL it used. But I'll defer to @ahmetalpbalkan on this one. |
Turning off the check on the daemon is way harder... For instance docker-swarm didn't have any release in the past 2 months and it still exposes the ancient API Version 1.16 which makes it impossible to use with new clients. Also any time I need to change some daemon setting I need to ssh, update setting and restart the service (therefore restart all containers)... Seems a lot tedious/dangerous than adding it to the client. |
If this can work in docker-py, how come it can't in official docker client? |
Closes: moby#11486 Just for @ahmetalpbalkan :-) Fixed some comment formatting too while in there. Signed-off-by: Doug Davis <dug@us.ibm.com>
Problem
Sometimes (or frequently) users have trouble talking to the docker engine with their docker client because they accidentally update their docker client and the server now has an older version.
It's too hard to get this right and that this usually happens by one off (e.g. client:1.18 server:1.17) and there is not major differences between these versions. This especially happens to the people who are compiling docker from
master
and talking to a Linux daemon in boot2docker or some cloud VM.This happens to me a few times a day as I'm finding myself upgrading to latest docker client version and all my servers are old or CoreOS is totally lagging two versions behind or something.
Proposal
I propose a power user environment variable
DOCKER_APIVERSION
used in the client to override the constant in api/common.go when set:This can easily help people to try out latest client binaries downloaded from master.dockerproject.com which has the latest bug fixes against their existing docker host deployed somewhere on the cloud.
Considerations
Since this enables the way of undefined behavior and feature set mismatch between the client and the engine this must be thoroughly documented that it is dangerous area. (and probably should exist only in development environment documentation instead of user guide).
Users will be seeing feature mismatches most of the time in the cutting-edge new features added to cli but missing from the docker host.
The text was updated successfully, but these errors were encountered: