I have the following in my docker file:
RUN sudo apt-get install sshpass -y
RUN sshpass -p userPassword scp -r user@server:~/data/* ./
But when I try and build my image it fails with:
Exception caught: The command '/bin/sh -c sshpass -p userPassword scp -r user@server:~/data/* ./' returned a non-zero code: 6 -> [Help 1]
However, if I remove these lines, build the image, ssh onto the container and manually run the command from bash it works perfectly.
Can anyone tell me how to get around this?