-
Notifications
You must be signed in to change notification settings - Fork 2k
Attach to existing machine from another client #1328
Comments
👍 |
How about adding it to the 2nd system using the 'generic' driver, and then use the same eval command there? |
@clnperez is this a proposal or something you're confident that it work (means that will reuse the existing remote machine even if currently running)? |
Well, in hindsight, I don't think you can do this b/c you'd have to set up the ssh keys again, or import them from your other system. |
I see your case. One can't add a docker-machine entry on the second system using the generic driver unless you want to invalidate the original docker-machine setup (since e.g. new creds are generated). One may run |
Correct. The only current way would be to take the entire directory but this won't work with some drivers (i.e. VirtualBox because it registers VMs and networks with UUIDs that would not match). There has been discussion around an import/export feature in the past (#23) |
I have a PR/hacky solution to this in the wings... Generally I think I want to move config over to being portable / templated instead of hardcoded like things are now. |
+1 I would love to be able to quickly reconnect to cloud instances (I'm using GCE) that already exist. Certainly having importable/exportable configs would be very useful, but I wonder if (additionally) addressing the issue as a driver concern might not yield a simpler user experience. That way, using the google driver, one could connect to an existing instance on an alternate computer simply by providing a valid access-token (which the driver may prompt the user to generate automatically). Similarly, when using the aws driver for instance, (which I have yet to do myself, but I presume) one could connect to an existing instance by providing a valid key/secret pair (perhaps through environment variables corresponding to the relevant driver-specific flags -- assuming that the process will occur through some docker-machine subcommand other than "create", since the expectations are a bit different). |
Just want to chime in that this would be a really great feature to have. I'd really like to be able to share a machine with my teammates and was disappointed to find out there was basically no way of doing this right now. It'd be awesome if, e.g. the |
:+1 . I would love to see it working. Currently we are co-managing the same machines (on Google Compute Engine) with another person and the only way I found working is to copy the whole directory (+ change the absolute links in the config.json file). That's lame. I think generic driver cannot be used easily this way - there is an issue of authentication of course (tls certs etc.) cannot be simply re-used when you run --create with generic driver (somehow you need to authenticate and prove that you have access to the machine which is different for every driver - in GCE you'd have to check if your gcloud authentication allows you to access the machine). Also there is a small issue that unless you already created the machine before with given driver, your authentication piece is missing (the only way to authenticate is to .. create machine). What I think is the best solution is to have "import" command (with different implementation for different drivers). For example in GCE, you could store all necessary details (keys etc.) somewhere in meta-data of the machine: https://cloud.google.com/compute/docs/metadata?hl=en#project_and_instance_metadata and then via specifying the project/machine name (and authenticating) you could get all the necessary keys and setup the machine. |
I would really appreciate this feature! |
@potiuk Which directory do you copy? |
@AlexZeitler |
+1! |
+1 I'd love to see a solution for this, too :-) |
I ran in exactly that problem today to give access to a colleague. |
+1 !!!!! |
Seems to be a duplicate of #23, right? |
This is absolutely required in continuous delivery scenarios, where you want to deploy using those keys from Travis or Circle CI. Any clue regarding ETA? |
gotta give this a |
+1 |
+1 Is there anything you have to do besides copying the |
@jbasrai Did the IP of what you're trying to access change? |
I've filed #2516 to start considering steps in the right direction to make this easier. |
This is a vital feature, and I'd love to see it in a near-future release. In my opinion machine configuration should remain unique to a client, not be imported/exported. Instead (as others have mentioned)
Instead it might warn me that the host already exists and continue to add the machine as it would in an initial creation (perhaps requiring that an override flag be passed). That way I can keep my dev/CI environment set-up scripts simple and not worry about having to store this configuration somewhere that my teammates (or other parties) can access it. |
It is indeed astonishing that for multiple persons to work on the same vm, we have to export/import certificates from one machine to another. If someone found a practical, production-ready solution, that would be good to know. |
+1 |
1 similar comment
+1 |
On Fri, Mar 10, 2017 at 6:16 AM, exjimsk ***@***.***> wrote:
I created a droplet to build a bunch of docker images to later realise I
need to move host region. How do I attach the docker-machine instance
restored from the snapshot running on the new host?
If the certs haven't changed, you should be able to just change your local
docker-machine config to point it to the new IP address. You'll find the
file at ~/.docker/machine/machines/your-machine-name/config.json.
Alternatively, if you never persist data in your Docker containers, instead
of moving the host, just kill it, make a new one, and start up the same
containers on the new host.
ᐧ
|
+1 |
7 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
It's pretty remarkable that such an obvious functionality still does not exist out of the box. We're going to jointly administer docker hosts, and this is such a nuisance. |
In my case, very happy to attach existing host
But need copy certificates(ca.pem, cert.pem, key.pem) to |
Any plans for this? Having full paths recorded in My use case: I have a git repo with machine configs in in it (I use the |
FYI: #3212 |
@lyda We're using such an approach with https://github.com/dmstr/docker-roj - but without encryption, which would be a very nice feature actually! While roj always works with the same paths, since it's in a container, there are other solutions like:
which basically change a few paths in the |
Is |
+1 |
2 similar comments
+1 |
+1 |
My god, the horror! This thread is still alive after almost three years?!? This is a use-case that everyone bumps into, or would seem to. What am I missing? |
Well I assume |
please support this :( |
add "~/.docker" to a folder that is rsynced or maybe symbolic linked to cloud folder on both machines. there are a couple pre-built solutions. not too hard guys, just do some research - never had an issue after setting up one time for 30 seconds. |
+1 |
1 similar comment
+1 |
How this feature, as well as specifying a static IP--- the two most requested features in the history of the docker-machine project--- goes unimplemented is beyond me. |
Almost 4 years have passed 😮 Are there any update on this? At the moment, many articles/tutorials about Docker are still suggesting to use docker-machine as the de-facto tool to manage hosts. However, this issue presence is a strong limiting factor! I am currently keep using docker-machine and use the “copy-certs-dirs” approach to share between our local computers. I would like to upgrade to Kubernetes but it looks just too much for my project. |
How about running |
Still doesn't have an attach, oh my god |
Lets consider I created a machine on Digital Ocean running some containers.
After creating the machine, I can run
eval "$(docker-machine env test-machine)"
Now I'm moving to another local computer which does not know about that particular machine and I want to attach to that machine.
How do I do that?
The text was updated successfully, but these errors were encountered: