Was facing above error because i was using jfrog server as host but the expected host is "reponame.host". For eg if the registry name is "test-jfrog-registry" and the host name is "abc.jfrog.io" then the right host would be test-jfrog-registry.abc.jfrog.io
and not abc.jfrog.io/test-jfrog-registry
Correct command
echo $JFROG_TOKEN | docker login test-jfrog-registry.abc.jfrog.io --username $JFROG_USERNAME --password-stdin