0

Stuck with this problem. Can docker-compose filter dirs during mount? For example, I have dir example.

example
├── cfg-project-1
├── cfg-project-2
├── cfg-project-3
├── project-1
├── project-2
└── project-3

volumes:
  - ./example:/tmp/s3-buckets

I do not know the exact number of subdirectories and their names, but I know the pattern. All configs repos have the cfg- prefix. So, I need to mount all content of example dir, which has this prefix cfg-

Maybe you have some ideas? Thanks a lot!

ioj
  • 1
  • 1
  • 1
    This is not possible. [Add a volume to Docker, but exclude a sub-folder](https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder) would recommend adding additional anonymous volumes for the other directories, but this will make things even harder to update. You'd need to mount the individual directories, or shuffle things so there's an `/example/cfg/` directory tree you could mount without overwriting other things. – David Maze Feb 22 '23 at 11:40
  • Thanks, that's what I was afraid of – ioj Feb 22 '23 at 11:55

0 Answers0