Skip to content
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

Accessing Host File System? #11

Closed
JeffHoogland opened this issue Jan 6, 2018 · 6 comments
Closed

Accessing Host File System? #11

JeffHoogland opened this issue Jan 6, 2018 · 6 comments
Labels

Comments

@JeffHoogland
Copy link

New to docker so this might be a docker thing more than an issue with this image - but is there an easy way to get access to my base file system through MTGO running in this docker image some how? Ideally I'd like to be able to import / export deck files.

@pauleve
Copy link
Owner

pauleve commented Jan 6, 2018

You have two options:

  • either you can bind your host filesystem to the docker container by adding -v /host/path:/container/path to run-mtgo call ; /mnt or /tmp/host are examples of common container paths you may use.
  • or, you can use docker cp to transfer data from/to the container while it is running. For instance

From docker to your computer

docker cp mtgo_running:/home/wine/mydeck.dek mydeck.dek

will export the file you saved from MTGO in /home/wine/mydeck.dek (Desktop/My Documents)

From computer to docker

docker cp mydeck2.dek mtgo_running:/home/wine/mydeck2.dek

will import the file from your computer in the container, accessible from MTGO in Desktop/My Documents

Here mtgo_running is the name of the container, which is set by run-mtgo.

Hope that helps!

@JeffHoogland
Copy link
Author

Thank you!

@kylesnowschwartz
Copy link

Hi, I'm running into the same issue and having trouble understanding the commands necessary to move a deck I exported from MTGO onto my Ubuntu host machine.

kyle@kyle-thinkpad:~$ touch tokens.txt
kyle@kyle-thinkpad:~$ cat tokens.txt | sudo docker exec -i mtgo_running tee tokens.txt >/dev/null

After running the following, my tokens.txt on my host machine is still an empty file. Am I misunderstanding the instructions?

I think the problem may be that the .txt files are being saved to C:\users\wine\Desktop\tokens.txt but I don't see how to save to /home/wine but I'm unsure. Thanks for any suggestions and thanks for this awesome project!

@JeffHoogland
Copy link
Author

The easiest way to is modify the run-mtgo script. For example I added this to opts:

-v /media/Storage:/mnt

Which mounted me /media/Storage on my host system to /mnt on the docker image.

@pauleve
Copy link
Owner

pauleve commented Feb 9, 2018

Hi, I've updated my answer to makes things clearer.
If you want to go from docker to your computer, you should use the cat command (and from your computer to docker the tee command).
I think the /home/wine can be accessed by using "Desktop/My Documents" in the left pane when you browse files with MTGO ; correct me if I'm wrong and I'll update my answer (otherwise, "Desktop > / > home > wine).

@kylesnowschwartz
Copy link

Thanks @JeffHoogland, figured it out with the following command:

sudo ./run-mtgo -v /home/kyle:/mnt

Thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants