authenticationrequired error when trying to pull docker images with Docker CLI - windows

I'm trying to pull a simple hello-world image from docker hub using :
docker run hello-world
But I'm getting this error on Windows 7 :
Unable to find image 'hello-world:latest' locally
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Get https://registry-1.docker.io/v2/: authenticationrequired.
I've tried so many different things but none seem to work :
1 - I tried logging in, but I'm getting the same error :
docker login
Tried my username, my email ... Same error :
Error response from daemon: Get https://registry-1.docker.io/v2/: authenticationrequired
2 - Restarted docker machine, same error.
3 - Reinstalling Docker and Oracle VirtualBox multiple times
4 - Done all the steps here : https://github.com/docker/kitematic/wiki/Common-Proxy-Issues-&-Fixes
I really don't know how to fix this anymore.

I had this problem when I tried to login to the docker behind a corporate proxy. Are you in a similar situation? If so, see if you add "https://registry-1.docker.io/v2/" to the exemption list for proxy's HTTPS analysis.
If you are not behind a proxy, check to see if you have any software that do a HTTPS analysis. Sometimes software like Fiddler or Antivirus does that. If you found anything like that see if you can whitelist the url
Hope it helps. I had a hard time figuring this out for my issue

Related

Fail to start tasks/services in Docker Swarm: hnsCall failed in Win32: The parameter is incorrect

I am trying the Docker Get Started tutorial, Part 3 (Services). So the part where I need to init a swarm and deploy a stack, all my service status is rejected:
The full error (using --no-trunc) is:
hnsCall failed in Win32: The parameter is incorrect. (0x57)
Here are the steps I am doing:
Ensure my image is correct (the docker run works well, I accessed localhost:4000 successfully). Then I stopped the container to make sure it does not interfere.
When I init the swarm, it says I have multiple addresses, so I chose a random one (I tried with either of them, same result) using --advertise-addr.
docker stack deploy works, but when I check the status with docker service ps, none of them are up. localhost:4000 has no listener.
Note: I switched Docker to a Windows container.
I am new to Docker and this is beyond me. Can anyone please suggest a solution/debug way?
I tried everything but cannot get it to run on a Windows container so I switched to Linux container. The Get Started part 3 runs well.

Docker and WSL error: UNAUTHORIZED

Recently started to use Docker in Windows because that's the enviroument where I work. I don't have any problem connecting WSL with Windows Docker an using it for first instance.
After reboot my laptop the problems cames to me. When I'm trying to create an image I get the next error:
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
Is so weird beacause if uninstall windows docker and reinstall it, everything works but if reboot or shut down my laptop, the problem comes again.
It seems like DNS resolve issues about Docker registry.
Sometimes DNS on DHCP information or your network settings makes this trouble on windows.
Try to change DNS options from Automatic to Fixed GoogleDNS(8.8.8.8) on Docker for Windows settings.
Please refer this screenshot.
Fixed DNS Settings on Docker for windows

Composer-Rest-Server not connecting

I am testing a a business network I created, I ran the Composer-rest-server and all worked fine, then shut the server as suggested in the developers guide , then I proceeded use the yo hyperledger composer to create the skeleton of the angular app, however, now the angular app is showing in the local browser, however, the composer-rest- server is not.
Expected Behavior:
I should start the composer-rest- server in localhost:3000 and the angular app as well
Actual Behavior:
I get this message;
scovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
at _checkRuntimeVersions.then.catch (/home/node/.nvm/versions/node/v6.11.2/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:696:34)
Your Environment
composer-cli#0.11.3
generator-hyperledger-composer#0.11.3
composer-rest-server#0.11.3
Docker version 17.06.0-ce, build 02c1d87
docker-compose version 1.13.0, build 1719ceb
The Problem
If you kill your fabric instance using ./stopFabric that you started using the ./startFabric command then all the containers that were apart of the business network were killed as well and therefore you need to reinstall the .bna and start the network again. (the development flow provided is purposely volatile for rapid development)
The Solution
1.) Type docker ps to see all of your running containers. You should see none if you are getting that error because your peer is not responding to pings
2.) Open a separate terminal and navigate to where you have fabric-dev-servers in the terminal and run ./fabricStart. This will start all the containers like your network Certificate Authority, the peer, the orderer, etc.
3.) Return to your project in another terminal. Do Step 1 & 2 found at the developer tutorial (you likely won't need to do step 3 since you likely already imported the network administrator identity going through the tutorial)
4.) Run composer network ping --card admin#tutorial-network. The ping should go through.
5.) Run docker ps. You should see 4 containers running
6.) Run composer-rest-server and follow the steps from the tutorial.
7.) Run cd tutorial-network-app to switch to where your angular application is (or wherever you generated it with the yo command)
8.) Navigate to http://localhost:3000 and everything should work.
Any other questions or problems just reply here and I can help.
The expected behaviour is that the REST server is already running (the the generator uses Loopback to spin up a REST server already (that's why you shut down the previous REST server)). Its described here https://hyperledger.github.io/composer/unstable/tutorials/developer-guide.html under 'Generate your Skeleton Web Application'.
After you created the application - following completion of the yo hyperledger-composer questions (and after providing the answers) you run your application using npm start from within the generated application directory. Your app is accessible at http://localhost:4200.

docker proxy pull windows 10

After install docker v1.12.0-rc2 on windows 10 pro machine, set the http and https variables, i get the following error:
docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error while pulling image: Get https://index.docker.io/v1/repos
itories/library/hello-world/images: x509: certificate is valid for FG200B3911602237, not index.docker.io.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
world image is images for Linux container, you can't use it on windows container.
At the moment, there're only about 9 or 10 images for windows containers, you can use it follow this article https://msdn.microsoft.com/en-us/virtualization/windowscontainers/deployment/deployment.
After install v1.12.0-rc3-beta18 build 5226 pull container works behind a proxy. tks #huy-tran

Error Pushing Docker Windows Image into Docker Hub - Error parsing HTTP response: invalid character / Request forbidden by administrative rules

I am trying to push a Windows Core Docker Image into my Docker Hub account. The error message (1) I am getting is:
$ docker push <MY_DOCKER_HUB_USERNAME>/<MY_IMAGE>
The push refers to a repository [docker.io/MY_DOCKER_HUB_USERNAME/MY_IMAGE] (len: 2)
46e2fd82ef4a: Preparing
Error parsing HTTP response: invalid character '<' looking for
beginning of value: "<html><body><h1>403 Forbidden</h1>\nRequest
forbidden by administrative rules.\n</body></html>\n\n"
Before pushing I am getting properly authenticated from my Mac OS X box by means of login usage:
$ docker login --username=<MY_USERNAME> --email=<MY_EMAIL#MY_SERVER.COM>
WARNING: login credentials saved in /Users/<MY_USERNAME>/.docker/config.json
Login Succeeded
Once I am authenticated, I see no point in getting a "403 Forbidden" error from Docker Hub. Also, it is not clear what these "administrative rules" are, but perhaps they are preventing me from getting my image pushed into Docker Hub registry. Please note that my repository is flagged as "public" as well my default policy ("Default Repository Visibility" from "Settings" in Docker Hub Dashboard).
I tried to do the same within my Windows Server Core box and was not able to get authenticated using the same credentials:
C:\>docker login --username=<MY_USERNAME> --email=<MY_EMAIL#MY_SERVER.COM>
Password:
Error response from daemon: Unexpected status code [403] :
<html><body <h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
Docker Client Version from Windows Core box:
C:\>docker --version
Docker version 1.10.0-dev, build 59a341e
Docker Client from Mac OS X box:
$ docker --version
Docker version 1.9.1, build a34a1d5
Windows Server Core version:
PS C:\> [System.Environment]::OSVersion.Version
Major Minor Build Revision
----- ----- ----- --------
10 0 10586 0
P.S.: No matter if I try to push from inside of my Mac OS X box (using my Windows Core box exposed API) or straight from inside of my Windows Core box, they will always lead to the same error message (1). It points me that the whole process depends on the authentication by the Windows Server Core box and since it is not properly working the results will always be the same.
The following answer was taken from ServerFault replica post:
At this time, that is expected behavior. Docker is still in the early
stages of Windows development. This documentation specifically states
that commands related to DockerHub are not supported yet. According to
jhowardmsft in #docker-dev (Freenode): "With (Win Server 2016)
Technical Preview 4, it should be able to push to a Docker Trusted
Registry".
Thanks to l0j1k who kindly answered based on a discussion we had in #docker-dev channel from IRC at freenode.
As for windows box while doing docker login I faced such error (guess it is similar):
docker login dockerserver.local:5006
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: Get https://dockerserver.local:5006/v1/: unauthorized: HTTP Basic: Access denied
It was solved by running terminal window (cmd shortcut) with administrator rights:

Resources