I’m new in rancher/docker world, and i am trying to find the best way to execute commands from Jenkins in an existing container (mainly bash and php commands), in order to use Jenkins as a job scheduler.
In my old infra, i was doing this by using “Execute SSH on a remote server”. But i read that’s it’s not the best way to achieve this when using docker, and that’s it’s better to use docker exec.
So what’es your advice to achieve this ? At the moment, i was figuring those scenariis :
- Installing openssh server on my app container, and SSH it from Jenkins using a link
- SSH on the host where the container app is running and use “docker exec” . But the difficulty will be to know where the container is hosted everytime the build is running in Jenkins
- Any ideas ?
Thanks a lot for your help