-2

I have window10 and SSD(e.g samsung SSD 256G)

If i created A Docker ubuntu container and access somewhere in there(e.g /home/myname)
and i created test.txt which contains "hello world", it might be in "/home/myname/test.txt"
and test.txt might have it's own size(8kb) i think it should get his room from samsung.SSD

i can access test.txt using 'docker attach' and also i know how to mount using -v option then i can change or update that file(i know it is just duplicated from Container)

But I wanna see or access test.txt file from My Window10 C-drive or window10-Desktop or using find/search function given from window10 how test.txt exists or using my samsung.SSD

sorry for lack of en, basic computing system.

the following comes from "https://docs.docker.com/storage/" it works not enough for me

By default all files created inside a container are stored on a writable container layer. This means that:

The data doesn’t persist when that container no longer exists, and it can be difficult to get the data out of the container if another process needs it.
A container’s writable layer is tightly coupled to the host machine where the container is running. You can’t easily move the data somewhere else.
Writing into a container’s writable layer requires a storage driver to manage the filesystem. The storage driver provides a union filesystem, using the Linux kernel. This extra abstraction reduces performance as compared to using data volumes, which write directly to the host filesystem.
Docker has two options for containers to store files in the host machine, so that the files are persisted even after the container stops: volumes, and bind mounts. If you’re running Docker on Linux you can also use a tmpfs mount. If you’re running Docker on Windows you can also use a named pipe.

Keep reading for more information about these two ways of persisting data.
BMW
  • 42,880
  • 12
  • 99
  • 116
dlacksrb
  • 3
  • 2
  • you can mount external location in your docker and write in that location – Aviral Kumar Jun 26 '20 at 02:18
  • thanks ahead, but i know how to us -v option ,i have question in what way the file in the virtual-system(docker,vmware) is stored in local samsung.SSD sorry if question dosen't make sense – dlacksrb Jun 26 '20 at 02:23

2 Answers2

0

so seems you don't udnerstand how -v works

$ docker run -ti --rm -v "<your_windows_path>:/apps -w /apps ubuntu bash
root@b2fd40f5f423:/apps# echo "helloworld" > test.txt

-w /apps (WORKDIR) to make sure you create the file in container will be the same path reflected to your windows path.

from your windows system, you should be fine to search this file under local disk or SSD disk with path <your_windows_path>

BMW
  • 42,880
  • 12
  • 99
  • 116
  • thank a lot, but i know how to mount by -v option, just i thought if any file(in here from docker container virtual env)get his room in my samsumg.SSD then I think I could access there from my Cdrive or desktop without using docker-tecknic – dlacksrb Jun 26 '20 at 02:44
0

Try the suggestions here:

https://stackoverflow.com/a/27320731/13064727

think this is a 2 step process, maybe you are missing the first step.

Donald S
  • 1,583
  • 1
  • 10
  • 26