Can not login to docker with docker toolbox - docker

I'm absolutely new to the docker and I want to push my docker image to docker hub. I'm running windows 7, so I have installed docker toolbox.
So, in power shell when I type:
docker login it asks for a login and a password, but when I hit enter, it gives me no information if login was successful.
But when I try docker push <image name>
I get an error: denied: requested access to the resource is denied
P.S.
If I enter incorrect login/password on docker login, it gives me the corresponding message

Solved! For anyone who may faced the following issue - the problem was that windows username was written not with latin letters. Creating another user with latin name fixed that problem.

Related

Certificate not valid for jfrog.io when using Docker registry

The documentation says I have to use jfrog.io and not jfrog.com. I also tried to login into jfrog.com, which did not work.
So it looks like acme.jfrog.io/acme is the right way to access my Docker registry.
Note: Also the hostname was missing in the description. I was only able to upload when specifying the full name, and setting the registry as insecure in my Docker configuration.
Is this a known issue? Or limitation of the free offering?
sudo docker login jfrog.io/acme
Username: admin
Password:
Error response from daemon: Get https://jfrog.io/v2/: x509: certificate is valid for jfrog.com, *.jfrog.com, not jfrog.io
Indeed, you should be using my-account.jfrog.io and not my-account.jfrog.com.
The docker login command which you are running is wrong. It is missing your account name (as a sub domain), so instead of calling jfrog.io you should be calling my-account.jfrog.io (for example daniel.jfrog.io)
The reason for getting the certificate error is that when trying to perform docker login directly to jfrog.io (without the subdomain) docker is trying to access an invalid URL - jfrog.io/v2. As a result it is being redirected to an 403 error page on jfrog.com which does not match the jfrog.io certificate.
To test your docker repository please follow the following steps:
Login to your repository with docker login command. Make sure to use your account name instead of my-account. Please notice that you do not need the repository name for the login command.
docker login my-account.jfrog.io
Pull the hello-world image from the Dockerhub
docker pull hello-world
Tag the hello-world image so it can be pushed to your repository (assuming it is a local repository and you have the permissions to push an image). Make sure to use your account name and repo name
docker tag hello-world my-account.jfrog.io/my-repo/hello-world
Push the tagged image to your repository
docker push my-account.jfrog.io/my-repo/hello-world

Login to Docker Hub by command line

I have read some Docker tutorials and I see this command line:
docker login -u LOGIN -p PASSWORD
But the registry server URL is never set.
How does the docker command know the registry URL? What is the URL for Docker Hub Registry? I have tried this:
docker login -u LOGIN -p PASSWORD cloud.docker.com
but it does not work.
If you want to login to the default Docker Hub repository, simply use:
docker login
or more specifically:
docker login registry-1.docker.io
You can also login using a Docker Hub Access Token: https://docs.docker.com/docker-hub/access-tokens.
To do that:
Access your Docker Hub account.
Click on your avatar (on the page top right side).
Click on Account and Settings.
Click on Security (on the page left side in the middle).
And then click on New Access Token button.
Give a token description, define the token permissions and click on Generate.
Copy and save your token.
Then log in with your new token. Type docker login -u <your-username> on your terminal and paste your Access Token when requested by the password.
docker login -u <your-username>
You may need to use a specific registry version, for me this worked.
docker login registry-1.docker.io/v1
In my case docker daemon is not running, so I just restarted it and re-executed same command. It worked!!
While login you may encountered with permission denied issues, in that case first give bellow command:
sudo chmod 666 /var/run/docker.sock
then use:
docker login

Docker in Docker unable to push

I'm trying to execute docker commands inside of a Docker container (don't ask why). To do so I start up a container by running.
sudo docker run -v /var/run/docker.sock:/var/run/docker.sock -it my_docker_image
I am able to run all of the docker commands (pull, login, images, etc) but when I try to push to my remote (Gitlab) registry I get denied access. Yes, I did do a docker login and was able to successfully log in.
When looking at the Gitlab logs I see an error telling me no access token was sent with the push. After I do a docker login I see a /root/.docker/config.json with the remote url and a string of random characters (my credentials in base 64 I believe)? I'm using an access token as my password because i have MFA enabled on my Gitlab server.
Appreciate the help!
I ended up resolving the issue by using docker:stable as my runner image. Not quite sure what the problem was with the centos:centos7 image.

Docker login problems [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Created username password on hub.docker.com but I still get authentication error when I run docker run hello-world, and even when I run "docker login" then enter my credentials ....but it shows a success message when I do
docker login -u <myusername> -p <mypassword> https://hub.docker.com
but even after that if I try to run
docker run hello-world
I get the same error:
"error response from daemon: login attempt to https://registry-1.docker.io/v2/ failed with status: 401 Unauthorized"
Try logging out first with docker logout
I often find that this will at least allow me to pull images when there is some authentication issue.
docker logout
docker login
DONOT put email address as “username” when login from CLI. Instead USE username of you account
A few things going wrong here. First the login command shouldn't specify a url. Instead you specify a registry. And for hub, you don't even include that:
docker login -u <myusername> -p <mypassword>
Next, the hello-world image doesn't require any authentication. If you have bad credentials setup, you can logout:
docker logout
If you still see issues after that, the most likely cause is a proxy on your network intercepting the request, and it's not docker Hub giving the 401 error, but instead it's the proxy server. You can configure docker to use a proxy by following both of the following:
Configure the client: https://docs.docker.com/network/proxy/
Configure the engine: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
Try this command first:
docker logout https://hub.docker.com
You should get an output like:
Removing login credentials...
Then try to login.
I had similar problem, in my case, my solution was, that I need to input the password via STDIN method as below:
first create a file with the content is your docker password, e.g. in ~/my_password.txt
Then login using this method:
cat ~/my_password.txt | docker login --username [your_username_here] --password-stdin
Remember, your username is not your email.
Test docker login With modify Docker General Config (macOS High Sierra 10.13.3 & Docker Engine:18.09.2)
1. With GUI Account login
1.1 With General -> Securely store Docker logins in macOS keychain (checked)
docker login failed
1.2 With General -> Securely store Docker logins in macOS keychain (unchecked)
docker login successed
it will Authenticating with existing credentials.
2. With GUI Account logout
2.1 With General -> Securely store Docker logins in macOS keychain (checked)
docker login failed
2.2 With General -> Securely store Docker logins in macOS keychain (unchecked)
docker login successed
SO,
unchecked General->Securely store Docker logins in macOS keychain, it solved my docker login failed problem

Docker: How to authenticate for docker push?

Hi i'm trying docker push
[docker-simple-httpserver]# docker push myregistry/simplehttpserver:latest
The push refers to a repository [myregistry/simplehttpserver] (len: 1)
Sending image list
FATA[0000] Error: Status 403 trying to push repository simplehttpserver: "{\"error\": \"Unauthorized updating repository images\"}"
is there a way for me to specify the username and password on docker push command?
I would think they keep passwords off the command line for security reasons.
The way to do it is to login first then push.
https://docs.docker.com/mac/step_six/
$ docker login --username=maryatdocker --email=mary#docker.com
Password:
WARNING: login credentials saved in C:\Users\sven\.docker\config.json
Login Succeeded
Then push
$ docker push maryatdocker/docker-whale
The push refers to a repository [maryatdocker/docker-whale] (len: 1)
7d9495d03763: Image already exists
c81071adeeb5: Image successfully pushed
Typically you would specify your password using the interactive docker login then do a docker push.
For a non-interactive login, you can use the -u and -p flags:
docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
The Travis CI docs for docker builds gives an example of how to automate a docker login.
See docker login for more details.
As far as I know you have to use docker login. The credentials will be stored in /home/user/.docker/config.json for following docker pushes.
If you are after automation the command expect will be interesting for you.
In case, one needs to login to the custom docker repo, use below:
docker login -u ${USERNAME} -p ${PASSWORD} ${DOCKER_REPOSITORY}
The accepted answer works perfectly fine! However, if you are trying to access a private registry, you may have to consider making the following change request.
docker login -u ${user_name} ${private_registry_domain}
Provide password, when it prompt for the same.
docker login --username=YOUR_DOCKERHUB_USERNAME
In this case your dockerhub password will be an access token.
Refer: https://docs.docker.com/docker-hub/access-tokens/#create-an-access-token
If you are tagging image with IP then login docker registry with IP, If you are tagging image with domain-name then login docker with domain-name, Somehow docker doesn't like mixing IP and domain and failing.
Not direct answer to the question, but you can first login and then do docker push.
docker login -unice-username
After which it will prompt for a password. After successful login you can do docker push.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
use "sudo docker login" not "docker login" as one uses the root account and the other uses your personal.
Personally I create the repo on dockers website prior to the upload.

Resources