It usually happens when copying the Docker commands to a Windows machine and then the unseen NBSP characters gets added in the command.
To fix it, copy the docker command first to an editor where NBSP characters can be seen like notepad++ or sublime and then remove the character and run the docker command.
These characters are not seen on notepad on Windows or Word and other text editors.