4

I start the container registry:

docker run --name artifactory -d -p 8081:8081 -p 8082:8082 docker.bintray.io/jfrog/artifactory-jcr:latest

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
Password:

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).

BMitch
  • 231,797
  • 42
  • 475
  • 450
mealesbia
  • 845
  • 2
  • 12
  • 28

3 Answers3

5

I tried it too and had to search for a while.

Using the API I saw: "message" : "status code: 503, reason phrase: In order to use Artifactory you must accept the EULA first"

I didn't find how to sign it using the UI but it worked this way:

$ curl -XPOST -vu admin:password http://localhost:8082/artifactory/ui/jcr/eula/accept

After that I was able to login:

$ curl -XPOST -vu admin:password http://localhost:8082/artifactory/ui/jcr/eula/accept
8:35
docker login localhost:8081/docker/test
Username: admin
Password:
Login Succeeded
lvthillo
  • 28,263
  • 13
  • 94
  • 127
2

First, let us test if the docker client can reach the JCR by running the below curl,

curl -u http://localhost:8082/artifactory/api/docker/docker/v2/token

Moreover, it looks like the docker client isn't taking localhost as the docker container's IP but the server's host, to check this, add the following line in /etc/hosts file,

127.0.0.1 myartifactory

then access it using myartifactory:8082 thru the UI and if it is accessible then use the docker login as "docker login myartifactory:8082"

Muhammed Kashif
  • 1,421
  • 3
  • 6
1

Because each repo can have different authentication or authorization, you need to login to a specific repo.

Let's say you created a docker repo "myrepo", you can login as follows

docker login localhost:8082/myrepo

  • got the same error: HTTP status: 503 Service Unavailable for docker login http://127.0.0.1:8082/test (which does exist in jfrog artifactory) – mealesbia Nov 21 '20 at 23:47