How to log in in jfrog container registry?

4.6k views Asked by At

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

3

There are 3 answers

0
lvthillo On BEST ANSWER

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
0
Muhammed Kashif On

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"

1
Vinny at AppCafe.com On

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