In my case , I have installed ssmtp package on my Unix based host . Because of some reason , the best way in my situation is using ssmtp binary(under /usr/sbin) on my host to send mail (html file) in my APP container .
I attemp to mount the host directory /usr/bin into container:
docker run -v /usr/sbin:/host_sbin --name=myapp -ti -p 889:80 -p 890:5432 myimage
and try to execute ssmtp , here are some awkward tries and their results :
In my APP container and under /host_sbin
ssmtp ---> bash: ssmtp: command not found
./ssmtp ---> bash: ./ssmtp: No such file or directory
So it seems that things are not simple as I think . Could anyone have done something like this share the solution with me ? And I'd appreciate if someone can explain me why that not work .