Enes Yıldız
Enes Yıldız

Reputation: 1

How can i manage files in my host machine on Docker

I am using Docker on my Windows machine and i want to copy a directory to another directory in my Windows host. I have a Maven project that does this on Windows using org.apache.commons.FileUtils library and it works just fine. I want to run this Maven project in my Docker container so that i can move files on my Windows via Docker.

When i tried doing it, it gave no error but there was no copy process either. Can i manage files on my host machine with Docker?

Upvotes: -1

Views: 247

Answers (2)

Sparko Sol
Sparko Sol

Reputation: 717

You can follow this: Docker: How to live sync host folder with container folder?

And learn about docker volumes from here: https://docs.docker.com/storage/volumes/

Upvotes: -1

BertC
BertC

Reputation: 2666

Most sensible anwwer: You should not want to do this. If you are working in a Container, don't have dependencies to the Host. Having dependencies to the Host contradicts why Docker exists.

But if you insist: You can do this by mapping the directories of the Host inside the Docker Container via Volumes. And then you can copy inside the Docker container.

Upvotes: 0

Related Questions