Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

add export and import #29

Closed
wants to merge 3 commits into from

Conversation

waitingkuo
Copy link

It's the implementation for #23

To export a machine, you can type

machine export MACHINE_NAME

to get a tar file.

Then you can use

machine import TAR_FILE

to import it in another computer.

Signed-off-by: Wei-Ting Kuo <waitingkuo0527@gmail.com>
Signed-off-by: Wei-Ting Kuo <waitingkuo0527@gmail.com>
Signed-off-by: Wei-Ting Kuo <waitingkuo0527@gmail.com>
@@ -36,6 +36,8 @@ func main() {
{"stop", "Stop a machine"},
{"upgrade", "Upgrade a machine to the latest version of Docker"},
{"url", "Get the URL of a machine"},
{"export", "Export a machine"},
{"import", "Import a machine"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be in alphabetical order.

@bfirsh
Copy link
Contributor

bfirsh commented Dec 6, 2014

Thanks so much! In addition to IRL comments, I've added some comments to the commits here.

@bfirsh
Copy link
Contributor

bfirsh commented Dec 6, 2014

To document what I said IRL: I think machine export should output the tar file to stdout, and machine import should read the tar file from stdin, like docker export/import.

@waitingkuo
Copy link
Author

Since commands.go changes, I'm going to refactoring. Here's my think:

  1. add a tar.go to deal with tar create and tar extract
  2. move the export & import logic into store
  3. modify export & import commands to suit the new format.

There're three options for adding a tar.go
a. use os/exec call the command line utility tar cv and tar xv
b. use go standard lib tar to build our own. it's my original design, but the format isn't same as the command-line one. We might need to align the block size to make it compatible of the command line tar
c. use the tar util in docker/docker.

which one is better?

@ehazlett
Copy link
Contributor

@waitingkuo would you mind syncing up with @sthulb on this? I can see where this would be useful. #260 is very close to this and I think we should all come together to decide how this should work. There are a couple of things like the format, what should be exported, what to do with machines that cannot be exported (local vs. remote), etc. Thanks!

@ehazlett
Copy link
Contributor

ehazlett commented Feb 6, 2015

Closing as this has stagnated. Please re-open to start the discussion again. You can also put comments in #260 as well. Thanks!

@ehazlett ehazlett closed this Feb 6, 2015
@waitingkuo
Copy link
Author

Hi @ehazleet Sorry for the late reply. Just came back from a trip. I'll take a look #260 and join the discussion soon.

hetong07 pushed a commit to hetong07/machine that referenced this pull request Mar 10, 2021
don't panic if hyper-v isn't enabled
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants