The main problem is that i have two containers: containerA and containerB. containerB is the container of Portia, which is running and i cant stop due to external reasons. And in containerA i need to execute a docker exec of containerB.
I've readen two main solutions, the first one that i already tried and it works is using ssh to run the script in the host but i cant have a user with no password and giving a password seems to me like it's not the best way to do this. The second way is using docker.sock and a docker compose file, but many people said in comments that this is not a secure way.
Can someone explain me other way or if i am wrong and why? Thanks for your time.