0

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.

  • 1
    Have a look at github.com/cweagans/docker-bg-sync. – Hedi Nasr Dec 4 '19 at 13:23
  • @HediNasr, interesting I will have a work - but I can't believe there are no better options than syncing :-) If it has 2-way syncing it might work, but I am looking for better options. – Nishant Dec 4 '19 at 13:27
1

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:

  1. Committed changes to the src and egg folders trigger a new image to be built.
  2. The new image is pushed to a Docker repository.
  3. 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).

| improve this answer | |
  • Very interesting perspective @Wesley Rolnick. CI/CD gives me an alternative perspective (in a nice way) to go about this problem. Are you saying that docker containers aren't actually meant for code development even though it solves a lot of developer problems like setting up an environment for development etc? During development, things will keep changing - but we don't want to create images out of that - it usually goes through a (version control) reviewing system before getting accepted etc. Anyway, food for thought! – Nishant Dec 4 '19 at 16:03
  • Is there any tool that can be used for the workflow I described? – Nishant Dec 4 '19 at 16:08
  • 1
    @Nishant - Correct, Docker containers are generally used to help deploy or provide developer tools but not provide an Integrated Development Environment (IDE) (e.g., SQL Server image, Dockerized API for app development) – Wesley Rolnick Dec 4 '19 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.