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

Export / import machines #23

Open
bfirsh opened this Issue Dec 6, 2014 · 51 comments

Comments

Projects
None yet
@bfirsh
Contributor

bfirsh commented Dec 6, 2014

Something like this should work for transferring machines:

 $ machine export test | ssh anotherhost machine import

(Maybe we could use machine inspect?)

@bfirsh bfirsh changed the title from Import machines to Export / import machines Dec 6, 2014

@arminc

This comment has been minimized.

Show comment
Hide comment
@arminc

arminc Dec 6, 2014

What's the gain on this one? The goal of using machine from my perspective is to set up a simple machine with docker on it (no fancy stuff or custom things). With that in mind creating or export->importing a machine is exactly the same and does not give me any benefit.

arminc commented Dec 6, 2014

What's the gain on this one? The goal of using machine from my perspective is to set up a simple machine with docker on it (no fancy stuff or custom things). With that in mind creating or export->importing a machine is exactly the same and does not give me any benefit.

@bfirsh

This comment has been minimized.

Show comment
Hide comment
@bfirsh

bfirsh Dec 6, 2014

Contributor

When you create a machine, you can only use it and manage it from a single computer. You might want to:

  1. backup your hosts
  2. transfer them to another computer
  3. share them with a team member
Contributor

bfirsh commented Dec 6, 2014

When you create a machine, you can only use it and manage it from a single computer. You might want to:

  1. backup your hosts
  2. transfer them to another computer
  3. share them with a team member
@waitingkuo

This comment has been minimized.

Show comment
Hide comment
@waitingkuo

waitingkuo Dec 6, 2014

Should we have a drop command so that we can remove the machine from the list without terminating it? I think it might be useful after some machines are exported and transferred to another computer.

waitingkuo commented Dec 6, 2014

Should we have a drop command so that we can remove the machine from the list without terminating it? I think it might be useful after some machines are exported and transferred to another computer.

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Dec 6, 2014

Member

What exactly will the saved file contain? i.e.; Will it contain the token for connecting to the daemon?

Ideally, there should be something to manage computers/people to have access to the host. Thinking along the lines of a one-time token that can be to connect a new computer to an existing host.

Member

thaJeztah commented Dec 6, 2014

What exactly will the saved file contain? i.e.; Will it contain the token for connecting to the daemon?

Ideally, there should be something to manage computers/people to have access to the host. Thinking along the lines of a one-time token that can be to connect a new computer to an existing host.

@cjellick

This comment has been minimized.

Show comment
Hide comment
@cjellick

cjellick Jan 9, 2015

@bfirsh @waitingkuo This seems like a really useful feature that we'd use at Rancher (we'd like to use machine server-side).

Any reason the implementation (#29) seems to have stalled. Anything I could do to attempt to hep?

cjellick commented Jan 9, 2015

@bfirsh @waitingkuo This seems like a really useful feature that we'd use at Rancher (we'd like to use machine server-side).

Any reason the implementation (#29) seems to have stalled. Anything I could do to attempt to hep?

@gastonmorixe

This comment has been minimized.

Show comment
Hide comment
@gastonmorixe

gastonmorixe Apr 24, 2015

+1 would be awesome

gastonmorixe commented Apr 24, 2015

+1 would be awesome

@Starefossen

This comment has been minimized.

Show comment
Hide comment
@Starefossen

Starefossen commented May 6, 2015

+1

@urish

This comment has been minimized.

Show comment
Hide comment
@urish

urish commented Jun 27, 2015

+1

@kevin-coyle

This comment has been minimized.

Show comment
Hide comment
@kevin-coyle

kevin-coyle commented Sep 8, 2015

+1

@kevinsimper

This comment has been minimized.

Show comment
Hide comment
@kevinsimper

kevinsimper Sep 15, 2015

We have create a tool that we use ourselves, to make it easy to export docker-machines. It basicly exports all the certificates ssh keys. Feedback is welcome!

https://github.com/blackbeardapp/docker-machine-export

kevinsimper commented Sep 15, 2015

We have create a tool that we use ourselves, to make it easy to export docker-machines. It basicly exports all the certificates ssh keys. Feedback is welcome!

https://github.com/blackbeardapp/docker-machine-export

@uptownhr

This comment has been minimized.

Show comment
Hide comment
@uptownhr

uptownhr Oct 13, 2015

might be an overkill but something like a docker-machine registry would be awesome!

uptownhr commented Oct 13, 2015

might be an overkill but something like a docker-machine registry would be awesome!

@cusspvz

This comment has been minimized.

Show comment
Hide comment
@cusspvz

cusspvz Oct 13, 2015

Currently we are using a git repo for sharing docker settings, problem is that some of us have virtualbox machines and thats the down-side

cusspvz commented Oct 13, 2015

Currently we are using a git repo for sharing docker settings, problem is that some of us have virtualbox machines and thats the down-side

@jeanlaurent jeanlaurent added this to the 0.X.0 milestone Nov 3, 2015

@docteurklein

This comment has been minimized.

Show comment
Hide comment
@docteurklein

docteurklein Nov 16, 2015

@kevinsimper how do you import them back?

docteurklein commented Nov 16, 2015

@kevinsimper how do you import them back?

@saada

This comment has been minimized.

Show comment
Hide comment
@saada

saada Nov 20, 2015

Does this issue include the idea of sharing swarm clusters between developers?

saada commented Nov 20, 2015

Does this issue include the idea of sharing swarm clusters between developers?

@docteurklein

This comment has been minimized.

Show comment
Hide comment
@docteurklein

docteurklein Nov 23, 2015

@saada I think it only covers credentials sharing, not cluster config.
It would be awesome tho to have this ability in machine.
Currently I only know of https://github.com/efrecon/machinery and https://github.com/nathanleclaire/moby

docteurklein commented Nov 23, 2015

@saada I think it only covers credentials sharing, not cluster config.
It would be awesome tho to have this ability in machine.
Currently I only know of https://github.com/efrecon/machinery and https://github.com/nathanleclaire/moby

@micheletedeschi

This comment has been minimized.

Show comment
Hide comment

micheletedeschi commented Dec 2, 2015

+1

@tonysickpony

This comment has been minimized.

Show comment
Hide comment
@tonysickpony

tonysickpony Dec 14, 2015

I am looking after the capability to share machine between users in the same hosts.
And is there a workaround for this ? I am copying the whole ~/.docker/machine/ folder for now

tonysickpony commented Dec 14, 2015

I am looking after the capability to share machine between users in the same hosts.
And is there a workaround for this ? I am copying the whole ~/.docker/machine/ folder for now

@fuse

This comment has been minimized.

Show comment
Hide comment
@fuse

fuse commented Jan 16, 2016

+1

@ffissore

This comment has been minimized.

Show comment
Hide comment
@ffissore

ffissore commented Jan 25, 2016

+1

@shanewow

This comment has been minimized.

Show comment
Hide comment
@shanewow

shanewow commented Feb 7, 2016

+1

@montytorr

This comment has been minimized.

Show comment
Hide comment
@montytorr

montytorr commented Feb 9, 2016

+1

@toh2526

This comment has been minimized.

Show comment
Hide comment
@toh2526

toh2526 commented Feb 11, 2016

+1

@lukaville

This comment has been minimized.

Show comment
Hide comment
@lukaville

lukaville commented Feb 17, 2016

+1

@arpagon

This comment has been minimized.

Show comment
Hide comment
@arpagon

arpagon commented Feb 18, 2016

+1

@gomex

This comment has been minimized.

Show comment
Hide comment
@gomex

gomex commented Feb 19, 2016

+1

@mhubig

This comment has been minimized.

Show comment
Hide comment
@mhubig

mhubig commented Feb 25, 2016

+1

@leandromoreira

This comment has been minimized.

Show comment
Hide comment
@leandromoreira

leandromoreira Feb 29, 2016

I think a better way to show your intention is to click on Subscribe (at right side Notifications )

leandromoreira commented Feb 29, 2016

I think a better way to show your intention is to click on Subscribe (at right side Notifications )

@schickling

This comment has been minimized.

Show comment
Hide comment
@schickling

schickling Mar 29, 2016

I've written an import/export script which you can use in the meanwhile until this feature gets implemented natively. Hope this helps :)

https://gist.github.com/schickling/2c48da462a7def0a577e

schickling commented Mar 29, 2016

I've written an import/export script which you can use in the meanwhile until this feature gets implemented natively. Hope this helps :)

https://gist.github.com/schickling/2c48da462a7def0a577e

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Mar 29, 2016

Member

@schickling perhaps something to be added to the "contrib" directory in this repository? https://github.com/docker/machine/tree/master/contrib/completion

Member

thaJeztah commented Mar 29, 2016

@schickling perhaps something to be added to the "contrib" directory in this repository? https://github.com/docker/machine/tree/master/contrib/completion

@schickling

This comment has been minimized.

Show comment
Hide comment
@schickling

schickling Mar 30, 2016

Unfortunately I don't have the time atm to do that but please feel free to pull it in there!

schickling commented Mar 30, 2016

Unfortunately I don't have the time atm to do that but please feel free to pull it in there!

@geovanisouza92

This comment has been minimized.

Show comment
Hide comment

geovanisouza92 commented Apr 11, 2016

+1

@grinnery

This comment has been minimized.

Show comment
Hide comment
@grinnery

grinnery commented Apr 16, 2016

+1

@ian-bartholomew

This comment has been minimized.

Show comment
Hide comment

ian-bartholomew commented May 12, 2016

+1

@gregkeys

This comment has been minimized.

Show comment
Hide comment
@gregkeys

gregkeys May 27, 2016

I wrote yet another little utility to export/import docker machines. We are using this for our CI deployment. https://www.npmjs.com/package/@mumbacloud/dmport

Thank you to kevinsimper for https://github.com/blackbeardapp/docker-machine-export I used your idea to export as JSON, which makes it quite portable for CI environments.

gregkeys commented May 27, 2016

I wrote yet another little utility to export/import docker machines. We are using this for our CI deployment. https://www.npmjs.com/package/@mumbacloud/dmport

Thank you to kevinsimper for https://github.com/blackbeardapp/docker-machine-export I used your idea to export as JSON, which makes it quite portable for CI environments.

@mxab

This comment has been minimized.

Show comment
Hide comment
@mxab

mxab May 27, 2016

I also started working on some export/import script, what I really don't understand why there some duplicated files in the certs and the specific machine folder machines/<myMachine>. Also after adjusting the paths in the config.json to some custom paths outside the .docker/machine/machines... I noted that docker still expects some certs/pems/keys to be located in that folder

Can anyone recommend some documentation on what should be where actually?

mxab commented May 27, 2016

I also started working on some export/import script, what I really don't understand why there some duplicated files in the certs and the specific machine folder machines/<myMachine>. Also after adjusting the paths in the config.json to some custom paths outside the .docker/machine/machines... I noted that docker still expects some certs/pems/keys to be located in that folder

Can anyone recommend some documentation on what should be where actually?

@StefanScherer

This comment has been minimized.

Show comment
Hide comment
@StefanScherer

StefanScherer May 31, 2016

Contributor

Looks like Node.js developers are actively using this (and rewriting own solutions). This one I found via Twitter

https://www.npmjs.com/package/machine-share

Sharing your Docker Machine config:

npm install -g machine-share
machine-export <machine-name>
machine-import <machine-name>.zip
Contributor

StefanScherer commented May 31, 2016

Looks like Node.js developers are actively using this (and rewriting own solutions). This one I found via Twitter

https://www.npmjs.com/package/machine-share

Sharing your Docker Machine config:

npm install -g machine-share
machine-export <machine-name>
machine-import <machine-name>.zip
@Nepoxx

This comment has been minimized.

Show comment
Hide comment
@Nepoxx

Nepoxx May 31, 2016

That same node package ( as mentionned by @StefanScherer ) has shell scripts as well if you don't have Node installed.

https://github.com/bhurlow/machine-share/blob/master/export.sh
https://github.com/bhurlow/machine-share/blob/master/import.sh

This is a workaround however, docker-machine should handle this and ideally provide a unique certificate per developer/user (so revocation is possible).

Nepoxx commented May 31, 2016

That same node package ( as mentionned by @StefanScherer ) has shell scripts as well if you don't have Node installed.

https://github.com/bhurlow/machine-share/blob/master/export.sh
https://github.com/bhurlow/machine-share/blob/master/import.sh

This is a workaround however, docker-machine should handle this and ideally provide a unique certificate per developer/user (so revocation is possible).

@mxab

This comment has been minimized.

Show comment
Hide comment
@mxab

mxab Jun 1, 2016

the problem I'm having with the current export/import scripts is that they will overwrite existing files in ~/.docker/machine/certs , won't they?

mxab commented Jun 1, 2016

the problem I'm having with the current export/import scripts is that they will overwrite existing files in ~/.docker/machine/certs , won't they?

@gregkeys

This comment has been minimized.

Show comment
Hide comment
@gregkeys

gregkeys Jun 1, 2016

i can only speak for dmport, it will overwrite files if they exist.

its not a problem for us though because we use it in a docker ci that
doesn't have any thing to overwrite since it's a new container on each
deploy.

I'm planning on cleaning up dmport soon i can add a flag which will prevent
overwriting existing files if it will help
On Jun 1, 2016 1:54 AM, "Max Bruchmann" notifications@github.com wrote:

the problem I'm having with the current export/import scripts is that they
will overwrite existing files in ~/.docker/machine/certs , won't they?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#23 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ADIV-3T7FEa9CJvn_UdTb9AeQfwI3lkCks5qHUjegaJpZM4DFGT5
.

gregkeys commented Jun 1, 2016

i can only speak for dmport, it will overwrite files if they exist.

its not a problem for us though because we use it in a docker ci that
doesn't have any thing to overwrite since it's a new container on each
deploy.

I'm planning on cleaning up dmport soon i can add a flag which will prevent
overwriting existing files if it will help
On Jun 1, 2016 1:54 AM, "Max Bruchmann" notifications@github.com wrote:

the problem I'm having with the current export/import scripts is that they
will overwrite existing files in ~/.docker/machine/certs , won't they?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#23 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ADIV-3T7FEa9CJvn_UdTb9AeQfwI3lkCks5qHUjegaJpZM4DFGT5
.

@opHASnoNAME

This comment has been minimized.

Show comment
Hide comment
@opHASnoNAME

opHASnoNAME commented Jul 7, 2016

+1

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Sep 12, 2016

We're using a docker container for this task - what else 😄

The idea is also to have the same environment (eg. cert configuration paths) for all users, mounted as a host-volume. You can use docker-machine, docker-compose and docker in containers created from roj. And you can pass the data-folder as a zip via email or put it into a private git repo.

schmunk42 commented Sep 12, 2016

We're using a docker container for this task - what else 😄

The idea is also to have the same environment (eg. cert configuration paths) for all users, mounted as a host-volume. You can use docker-machine, docker-compose and docker in containers created from roj. And you can pass the data-folder as a zip via email or put it into a private git repo.

@ricardodantas

This comment has been minimized.

Show comment
Hide comment

ricardodantas commented Oct 19, 2016

+1

@jcrben

This comment has been minimized.

Show comment
Hide comment
@jcrben

jcrben Nov 13, 2016

I'm not sure my use-case is the same as others - I've created a couple different machines for different purposes and I want to back up their existence and (minor) configuration. I'd rather just have some simple text files which are used to recreate the boxes.

https://www.npmjs.com/package/machine-share doesn't seem to respect my MACHINE_STORAGE_PATH. schickling's script backs up couple large binary files (e.g., boot2docker.iso). https://www.npmjs.com/package/@mumbacloud/dmport threw a couple errors.

jcrben commented Nov 13, 2016

I'm not sure my use-case is the same as others - I've created a couple different machines for different purposes and I want to back up their existence and (minor) configuration. I'd rather just have some simple text files which are used to recreate the boxes.

https://www.npmjs.com/package/machine-share doesn't seem to respect my MACHINE_STORAGE_PATH. schickling's script backs up couple large binary files (e.g., boot2docker.iso). https://www.npmjs.com/package/@mumbacloud/dmport threw a couple errors.

@montanaflynn

This comment has been minimized.

Show comment
Hide comment
@montanaflynn

montanaflynn Nov 30, 2016

We also want this functionality, we've created a machine on gcloud using docker-machine for development and I want to allow my coworker to exec into the container and view the logs.

montanaflynn commented Nov 30, 2016

We also want this functionality, we've created a machine on gcloud using docker-machine for development and I want to allow my coworker to exec into the container and view the logs.

@bmmathe

This comment has been minimized.

Show comment
Hide comment
@bmmathe

bmmathe Jan 13, 2017

I'm actually surprised this isn't supported already. My example is I created a docker swarm cluster in Azure from my laptop (without thinking this all the way through) and now I want other devs to be able to manage the cluster so I created a shared VM in Azure that everyone can share. I installed docker-machine and now I need a way to import the machines from my laptop to our jump box in Azure.

bmmathe commented Jan 13, 2017

I'm actually surprised this isn't supported already. My example is I created a docker swarm cluster in Azure from my laptop (without thinking this all the way through) and now I want other devs to be able to manage the cluster so I created a shared VM in Azure that everyone can share. I installed docker-machine and now I need a way to import the machines from my laptop to our jump box in Azure.

@colthreepv

This comment has been minimized.

Show comment
Hide comment
@colthreepv

colthreepv Jan 13, 2017

@jcrben Hi, what about posting a full issue on machine-share, regarding the MACHINE_STORAGE_PATH?

I recently reviewed bhurlow's work, and I am curious to see if something breaks

colthreepv commented Jan 13, 2017

@jcrben Hi, what about posting a full issue on machine-share, regarding the MACHINE_STORAGE_PATH?

I recently reviewed bhurlow's work, and I am curious to see if something breaks

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Jan 14, 2017

@jcrben Did you also try https://github.com/dmstr/docker-roj? ... I am just curios.

schmunk42 commented Jan 14, 2017

@jcrben Did you also try https://github.com/dmstr/docker-roj? ... I am just curios.

@ntwrkguru

This comment has been minimized.

Show comment
Hide comment
@ntwrkguru

ntwrkguru May 1, 2017

People, for the love of all things proper, please 👍 the OP and not as a discrete comment. "+1" spam distracts from the conversation.

ntwrkguru commented May 1, 2017

People, for the love of all things proper, please 👍 the OP and not as a discrete comment. "+1" spam distracts from the conversation.

@lnshi

This comment has been minimized.

Show comment
Hide comment
@lnshi

lnshi commented Sep 7, 2017

FYI: #3212

@pedrodevoto

This comment has been minimized.

Show comment
Hide comment
@pedrodevoto

pedrodevoto Jan 2, 2018

@lnshi I think that the problem with importing an existing docker server with docker-machine create -d generic ..., is that it recreates certificates and restarts Docker, so not appropriate for a production/teamwork scenario.

pedrodevoto commented Jan 2, 2018

@lnshi I think that the problem with importing an existing docker server with docker-machine create -d generic ..., is that it recreates certificates and restarts Docker, so not appropriate for a production/teamwork scenario.

@lnshi

This comment has been minimized.

Show comment
Hide comment
@lnshi

lnshi Jan 2, 2018

@pedrodevoto I know, I just mentioned that issues, since ppl have discussed there a lot.
For now I don't think there is a proper solution yet.

lnshi commented Jan 2, 2018

@pedrodevoto I know, I just mentioned that issues, since ppl have discussed there a lot.
For now I don't think there is a proper solution yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment