This seems to be the right idea: https://stackoverflow.com/questions/29328278/installing-jenkins-plugins-to-docker-jenkins/29328489#29328489
so in the Dockerfile you'd just use:
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/plugins.txt
I tried it and it worked for me.
Installing it as a tool allows Jenkins to manage the binary and ensure it's available for your build while also providing supporting pipeline syntax withEnv(). Having an agent with the binary allows you to shell out and run your commands using sh without withEnv(). It also allows you to decide where these binaries come from depending on your agent type (...
First you need to install sshpass.
Ubuntu/Debian: apt-get install sshpass
Fedora/CentOS: yum install sshpass
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM
Custom port example:
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400
sshpass can also read a ...