0

I can bash into one of the containers, but sometimes it's much easier to view it in GUI app such as Windows File Explorer or Total Commander.

Is it possible in any way?

Tar
  • 8,529
  • 9
  • 56
  • 127

1 Answers1

0

If the only thing you want is to view folder inside your container while in development, you can use the BIND MOUNTS: https://docs.docker.com/storage/bind-mounts/, which is kind of volume

This allows you to set "full" connection between your container specific folder to an input folder within your local machine.

You can apply it via ternimal with: docker run ......... -v <path_within_your_local_machine>:<path_within_container_file_system>.

Tal Rofe
  • 457
  • 12
  • 46
  • It's creating the folder, but it's empty – Tar Jan 05 '21 at 15:54
  • @Tar Please provide at least partial code of what you have been trying. – Tal Rofe Jan 05 '21 at 15:56
  • Issuing this command: `docker run --rm -it -v c:\aaa\cont:/srv/my my-image` results in a new directory being created at `c:\aaa\cont`, but this directory is empty. There must be something, as `/srv/my` isn't empty. – Tar Jan 05 '21 at 15:58
  • you can use the command `docker cp`. documentation: https://docs.docker.com/engine/reference/commandline/cp/ @Tar – Tal Rofe Jan 05 '21 at 16:07
  • Yep, that's working, but it's not a direct access to the container. – Tar Jan 05 '21 at 16:33
  • What do you mean by direct access? Because this `docker cp` command does copy your direct files/folders off your container file system. Anyway, If you do want continuous connection, you need to use the `bind mount` option. – Tal Rofe Jan 05 '21 at 17:07
  • Generally, `bind mount` option does copy your non-existence files & folders locally from docker container file system into your local file system. The command you have executed should have done the work. Maybe provide some more details – Tal Rofe Jan 05 '21 at 17:09
  • You might want to have a look at: https://stackoverflow.com/questions/31448821/how-to-write-data-to-host-file-system-from-docker-container It states your problem, and specifically I'd reckon on focusing in "Software Engineer" Answer – Tal Rofe Jan 05 '21 at 17:19
  • it makes sense indeed that files are being copied, but it's behind the scenes. I do want to try the method you suggested - `bind mount`. But I may be missing something, as it's not working: issuing `docker run --rm -it -v c:\aaa\cont:/srv/my my-image` merely creating an empty directory for me, I'm not seeing all the files that reside in that directory. Again, I believe that I'm missing something, but unsure what... – Tar Jan 06 '21 at 12:00
  • @Tar As I do not have access to your complete project files, the only option I got you is to follow the link I've provided in my previous comment. Or - you could create brand new question which focueses on your problem with `BIND MOUNT` – Tal Rofe Jan 06 '21 at 12:28