fix error in docker build when param is not a directory

Fixes #1750