There’s some magic that occurs to obtain phantomJS
The build.rb script executes the download_phantomjs
script on the host, which spins up a docker container, which I’m guessing builds a custom version of phantomJS.
So if you run that download_phantomjs script first it should work
https://github.com/discourse/discourse_docker/blob/master/image/build.rb#L98
https://github.com/discourse/discourse_docker/blob/master/image/base/download_phantomjs