Hello,
I am trying to dockerize an application that launches and controls other docker containers. This application uses compose files to launch the other needed containers. I am doing this by mounting the docker socket in the container. In order for this to work I am updating the compose files the application uses to launch the other containers so that the volumes and mounts are correctly referencing locations on the host and not in the container the application is running in. This is working well, and It is launching sibling containers on the host.
I am hitting a roadblock though when this application needs to launch containers with individual files bind mounted from the host into the containers, from discussion here: docker - How to mount a single file in a volume - Stack Overflow
I see that for bind mounts docker first checks for the files/directories existence and if not found it attempts to create a directory there. The issue is that this check assumes the reference is local on the container and not on the host and so it always fails, even though if it passed and used the docker sock context to launch the container it would find the file on the host.
Because of this I am getting an unknown file error. What is the correct approach here? This seems like a bug to me that this check ignores the context it is being run with. How can I get around this and mount files from the host to the sibling containers like I can with volumes?