How can I access directories inside a docker container from outside (not the reverse!)? I am trying to setup plug-and-play docker images for my development and support team members - however I am running into some problems because I want them to be able to use the editor of their choice!

There are two critical folders that are part of the build (eggs and src) that needs to be exposed to the end users so that they can edit it in any editor of their choice.

All the options to edit container files in host machine talks about mounting a fresh folder from the outside; but like I said, my src and egg folders are part of the build, so I can't let them mount a fresh folder during docker run.

I thought of about using volumes, but here are the questions I have on this approach:

1) Do we usually put build stuff that are actually part of the container into volumes? The container has no meaning without these volumes.

2) Can end users take a copy of these volumes and just modify it according to their convenience without the master copy of these volumes? (Like Image vs Container concept?)

All my problems will be solved if I can expose folders inside my container to the outside (not the reverse), but that seems really tricky to achieve!

PS: I haven't research enough on volumes but I thought I could ask this question anyway.



Just to complete the workflow, our development/support team usually identifies and fixes these problems in their machine, sends a PR to the Git system which then gets merged etc.

I am trying to use Docker to solve the problem of not re-building the entire web-app in each developers machine running multiple OSes etc.
I think you may be using the wrong tool for the job.  Docker is not designed to be a version control system, it is designed for containerization.  Furthermore, your question makes it sound like the development and support team members are constantly changing the files that are essential to the makeup of the image.  This makes using a volume pointless as the Docker image will always be changing.

If I'm understanding what you are trying to achieve (people should be able to modify the src and eggs folders with whatever editor they want), then you may want to explore adopting a CI/CD workflow:


Committed changes to the src and egg folders trigger a new image to be built.
The new image is pushed to a Docker repository.
Team members can then pull the updated image.


As for your two specific questions:


  Do we usually put build stuff that are actually part of the container into volumes? The container has no meaning without these volumes.


Not usually.  Generally if I have to make changes to a container I would remote into it and then commit the changes.


  Can end users take a copy of these volumes and just modify it according to their convenience without the master copy of these volumes? (Like Image vs Container concept?)


This is sounding like a version control system which Docker is not designed for.  You can have a shared volume that users have access to, but the use case is for persisting data outside of containers (e.g. SQL database data).