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).
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
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"
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
Related
I am facing the following issue.
I have a harbor private registry and i am trying to login through docker cli.
I am able to login successfully with: docker login <harbor_ip>. When i execute this command the cli is asking me for username and password and it logins successfully.
But when i try to login with the following command docker login -u <username> -p <password> <harbor_ip> i get the following error:
unauthorized: authentication required
Bear in mind i am using the same credentials.
Why this is happening?
when you are using haproxy or cdn infront of harbor to handle ssh termination, its important to set external_url in harbor.yml file.
it solved my problem
Please wrap your username and password with single quote
docker login -u '<username>' -p '<password>' <harbor_ip>
I am able to get a token with:
(base) ➜ ~ curl artifactory.example.com/artifactory/api/docker/null/v2/token -u myusername:mypassword
{"token":"mytoken","expires_in":3600}
However when I try to login:
(base) ➜ ~ docker login artifactory.example.com -u myusername -p mypassword
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get http://artifactory.example.com/v2/: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /artifactory/api/docker/null/v2/token was not found on this server.</p>\n</body></html>\n"
It's like it's trying to do http://artifactory.example.com/v2/artifactory/api/docker/null/v2/token when it should be doing http://artifactory.example.com/artifactory/api/docker/null/v2/token?
The registry API requires that it is at the root of the url, and will not work under a path based reverse proxy. You need to allocate either a port or hostname to the docker API that responds to a request for /v2 on that hostname. Artifactory implements this by giving you a reverse proxy config generator.
How is your example.com is setup? For me it looks like you are using the repository path as docker access method here. From the error it seems that the docker client got a HTML response instead of a response from Artifactory. It looks like the request did not reach Artifactory at first. Kindly share if any reverse proxy is on top of the example.com?
If possible, directly test it out with the IP as "docker login 12.23.34.45:8081" and let us know if this helps. If the login is successful then the issue is with the reverse proxy being used here. Share the reverse proxy logs and configs to look into it.
I have 2 EC2s, one with Gitlab-ee installed, another with Docker installed and running Gitlab-Runner and a Registry container.
Gitlab-Runner is working, and picks up the commit to Gitlab, shipping it to docker for it's build phase. However during the build phase when the docker container attempts to login to the Registry container it errors with "http: server gave HTTP response to HTTPS client"
Docker Login code:
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
Troubleshooting done:
If I ssh into the server, I can login with sudo docker login localhost:5000
The same error occurs if the registry is referenced with $CI_REGISTRY / localhost / DNS name
I ensured the CI_REGISTRY is set in gitlab.rb
I saw some mentions online about needing to use the --insecure-registries flag in the docker.service Exec line, and I did that as well and get the same error.
This works if the docker installation is on the same server, but I'm trying to decouple the two applications from each other so they can be managed separately.
Software verions:
Docker Version: 19.03.6
Gitlab-ee Version: 12.8.1
Gitlab-Runner Version: 12.8.0
If anyone could help me on this, it would be greatly appreciated! I've been banging my head against it for 2 days.
Ok so I'm trying to make Bitbucket build a docker image using Bitbucket pipelines and I could sign in a week ago but now it doesn't work anymore.
And I'm using the same username and password, here it's a list of the commands I have tried and their output.
docker login cloud.canister.io:5000 --username $CANISTER_USERNAME --password $CANISTER_PASSWORD:
Error response from daemon: Get https://cloud.canister.io:5000/v2/: authorization server did not include a token in the response
docker login --username $CANISTER_USERNAME --password $CANISTER_PASSWORD cloud.canister.io:5000
Error response from daemon: Get https://cloud.canister.io:5000/v2/: authorization server did not include a token in the response
docker login cloud.canister.io:5000 --username $CANISTER_USERNAME
Password: xxxxxxxxxxxxxxxxxxx
Error saving credentials: error storing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY
echo "$CANISTER_PASSWORD" | docker login cloud.canister.io:5000 --username $CANISTER_USERNAME --password-stdin
Error response from daemon: Get https://cloud.canister.io:5000/v2/: authorization server did not include a token in the response
echo "$CANISTER_PASSWORD" | docker login --username $CANISTER_USERNAME --password-stdin cloud.canister.io:5000
Error response from daemon: Get https://cloud.canister.io:5000/v2/: authorization server did not include a token in the response
I've also tried on a local machine and tried to do it without environment variables also tried to sign out and then try to sign in again but nothing works
for logging in this worked for me:
docker login --username=USERNAME cloud.canister.io:5000
Unfortunately, i am still getting this error message whenever i try to push my image.
I had the same issue when trying to push a new image to cloud.canister.io. It turned out I had not created the repository through the web frontend yet.
After creating the repo on cloud.canister.io I could successfully push my image up.
First you need to create an empty repo on cloud.canister.io
website with same name of the image you are trying to push.
Then you will be able to push to that repo.
Make sure you have authenticated the canister account using
sudo docker login --username=<username> cloud.canister.io:5000
Been a while. But this helped me:
docker push (registryFullUrl)/$(dockerId)/$(imageName):$(MAJOR).$(MINOR).$(PATCH)
where:
$(registryFullUrl) = cloud.canister.io:5000
$(dockerId) = your canister id
$(imageName) = repository name
$(MAJOR).$(MINOR).$(PATCH) = version
This worked for me. Hopefully this will be helpful to somebody.
I built an image from a custom Dockerfile. I am running Docker Desktop on my Win11.
docker build -t <image>:<tag> .
I logged into canister.io.
docker login --username=<username> --password=<username> cloud.canister.io:5000
I tagged the build.
docker tag <image>:<tag> cloud.canister.io:5000/<canister-namespace>/<canister-repo>
I pushed the image to canister.
docker push cloud.canister.io:5000/<canister-namespace>/<canister-repo>
I deleted the image from my Docker Desktop and I tried to pull it from canister.
docker pull cloud.canister.io:5000/<canister-namespace>/<canister-repo>
Here's an examples with some dummy values:
docker build -t tc5:tc5tag .
docker login --username=myusername --password=mypassword cloud.canister.io:5000
docker tag tc5:tc5tag cloud.canister.io:5000/mynamespace/testrepo
docker push cloud.canister.io:5000/mynamespace/testrepo
# pull test
docker pull cloud.canister.io:5000/mynamespace/testrepo
I have a really strange issue with the non interactive docker login command. I am trying to login to my docker repository using the following command:
docker login -u emi -p 123 my.dockerrepo.com:5000
This command returns the following error:
Error response from daemon: login attempt to https://my.dockerrepo.com:5000/v2/ failed with status: 401 Unauthorized
However, if I run the above command without -p and enter the same password in the shell it works perfectly.
Consider using a single quotations. According to the spec it should work but I ran in to the same problem before with docker version 17.03.0-ce docker login -u 'emi' -p '123' my.dockerrepo.com:5000 would work in your case.