How to log in in jfrog container registry?

I start the container registry:

docker run --name artifactory -d -p 8081:8081 -p 8082:8082

I was able to login using the UI and create a repository etc.

Now I want to login using the CLI:

docker login localhost:8082
Username: admin
Error response from daemon: Get http://localhost:8082/v2/: received unexpected HTTP status: 503 Service Unavailable

What am I doing wrong? I got the same error when I use my local 192.168.x.x address (and after adding it to my insecure registries).

Source: Docker Questions