简体   繁体   中英

How to log in in jfrog container registry?

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.xx address (and after adding it to my insecure registries).

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

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

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM