Hi Jackie
Hope you are doing well.
By default docker is not found in build environment of yocto. as default yocto not uses local path in build environment. I am not aware how your script (build.sh) implemented or complex.for quick you can try with export PATH variable in your build.sh.
#! /bin/bash
export PATH=/usr/bin:$PATH
or you can implement docker command with full path in your script as below
/usr/bin/docker <argument>
You can find more details on docker and yocto community support. I had created a small script which used docker command and built with a recipe, its was not giving such type of error. Hope this will help you
Regard ,
Tushar