I have a helper container and an app container.
The helper container handles mounting of code via git to a shared mount with the app container.
I need for the helper container to check for a package.json
or requirements.txt
in the cloned code and if one exists to run npm install
or pip install -r requirements.txt
, storing the dependencies in the shared mount.
Thing is the npm command and/or the pip command needs to be run from the app container to keep the helper container as generic and as agnostic as possible.
One solution would be to mount the docker socket to the helper container and run docker exec <command> <app container>
but what if I have thousands of such apps on a single host.
Will there be issues having hundreds of containers all accessing the docker socket at the same time? And is there a better way to do this? Get commands run on another container?