sshpass not executing in bash script

I have a dockerfile: (these are the relevent commands)

RUN apk app --update bash openssh sshpass

CMD ["bin/sh", "/home/build/build.sh"]

Which my dockerfile gets ran by this command

docker run --rm -it -v $(pwd):/home <image-name>

and all of the commands within my bash script, that are within the mounted volume execute. These commands range from npm installs to using tar to zip up a file and I want to SFTP that tar.gz file.

I am using sshpass to automate logging in which I know isn’t secured, but I’m not worried about that with this application.

sshpass -p <password> sftp -P <port> [email protected] << EOF
    <command>
    <command>
EOF

But the sshpass command is never executed. I’ve tested my docker run command by appending /bin/sh to it and trying it and it also does not run. The SFTP command by itself does.

And when I say it’s never executed, I don’t receive an error or anything.

Source: StackOverflow