Docker image ls does not look at the proper IP address - docker

I can see my machine … Windows 10 Home
usuario#DESKTOP-GTCQCAR MINGW64 /c/Program Files/Docker Toolbox
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.101:2376 v18.05.0-ce
But when I try to list the images it tries to connect to a different IP ending in 100, instead of 101 where the docker machine is:
usuario#DESKTOP-GTCQCAR ~
$ docker image ls
error during connect: Get https://192.168.99.100:2376/v1.37/images/json: dial tcp 192.168.99.100:2376: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
It can not connect. How can I fix it?

I also faced similar problem after updating from Docker toolbox to Docker for windows.
I solved this problem by deleting all the environment variables starting with Docker.
I am not sure if it will solve your problem as well, but may be it will help someone.

This can also be helpful
Issue can be of having Docker Toolbox installed before changing to Docker for Windows
Uninstalled Docker for windows (make sure Docker Toolbox and VirtualBox are uninstalled as well)
Go to C:\users[USER] directory and remove .docker directory if it is there.
Remove Environmental Variables:
DOCKER_TLS_VERIFY
DOCKER_CERT_PATH
DOCKER_HOST
DOCKER_TOOLBOX_INSTALL_PATH
You might want to restart you computer just to be safe.
Reference: https://forums.docker.com/t/docker-starts-but-trying-to-do-anything-results-in-error-during-connect/49007/5

Check out this great guide: https://docs.docker.com/toolbox/faqs/troubleshoot/
Good luck

Related

Losing connectivity in WSL2 after docker start

I lose connectivity in my WSL2 when I start docker
$ curl google.fr
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
$ sudo service docker start
$ curl google.fr
<timeout>
I know all about WSL2 connectivity issues with VPN and cisco anyconnect.
But in this particular case I'm not connected to any VPN.
To restore connectivity to the internet I have to do wsl --shutdown in PowerShell. But then I lose docker...
Found a simple fix.
The pb commes from docker using the same network than WSL2.
To fix this issue you should explicitly tell docker to use a different network.
Add this to your /etc/docker/daemon.json
{
"bip" : "10.10.0.1/16"
}
If the file doesn't already exists, create it.
Credits : https://github.com/microsoft/WSL/issues/4285#issuecomment-1180567785
Now that the bip is different you will probably need to update it on other technologies relying on docker. For instance on minikube you must define the new bip as a parameter during launch.
For ie :
minikube start --docker-opt bip=10.10.0.1/16
EDIT
Some time later all stoped working once again. To fix it I deactivated self generating resolv.conf (sudo nano /etc/wsl.conf) then killed wsl2 using powershell with wsl --shutdown. Opened a new shell, started docker then edited /etc/resolv.conf and replaced the content with nameserver 8.8.8.8. After exiting, internet connectivy was back.
Don't ask why ! Just have faith...

Can not run docker command on windows 7

can not run docker on windows7 command after installation, and there is nothing in virtualbox.
I have tried uninstall and install other versions, run install application administrately and try another dirver but above does not work.
...
when installation finished, i clicked the docker quickstart terminal, and it show me this error message:
dial tcp 127.0.0.1:53822: connectex: No connection could be made because the tar
get machine actively refused it.
Looks like something went wrong in step ´Checking if machine default exists´...
Press any key to continue...
Just a reminder, there are sort of 3 ways to use docker on Windows, if one doesn't work you may want to try another one:
use docker Desktop: it requires windows 10 Pro (In fact Hyper-V maybe it's an option for you)
use docker Toolbox: the one you may have installed on windows 7, it uses Virtualbox and a docker machine VM.
use Virtualbox directly: install a linux distribution with shared folder only for your docker usage
Now since you are on option 2, you should have a virtualbox installed, so you can check if the underlying docker machine is launched by launching virtualbox, it should list the installed vm.
If the vm is not started: you will have to search the problem on virtualbox side, error logs or popup: trying to launch the vm manually directly from virtualbox application will help you
If the vm is started: there may be a connection problem between your host (windows) and your vm (boot2docker), you could try to connect to the vm via bash using "boot2docker ssh" as it is indicated in the quick start. If it works, the connection problem could come from a firewall.
Check if the quick start happened correctly when you have luanched it.
I don't want to make proselitism on other solution, but it may be simpler to use a linux directly in virtualbox (option 3), at least at the beginning to get more familar with docker.
The other simpler option would be to use windows 10
I'm sorry it's not a complete solution, but indications, and it was too long for a comment.
docker server is not running properly. check is you can run docker ps or docker version command successfully.

How to avoid docker toolbox IP invalid certs?

I am tesing docker on Windows 7 machine by installing docker toolbox.
It works for a while. Then its IP changed from 192.168.99.100 to 192.168.99.101.
When I run $docker image ls. It tells me that my certs is signed by unknown authority.
I resolved this by running $docker-machine regenerate-certs and then copy those files from .docker/machines/machine/default to .docker/machine/certs. It recovers.
But the problem is, the IP changes every now and then. I have to go through this process all over again.
Is there a way to config and avoid this from happening?

Docker for Windows: error pulling image configuration: i/o timeout

I have installed the latest version of Docker for Windows (1.12.1-stable, build 7135) on my Windows 10 Pro-64 bit. I was able to successfully execute docker run hello-world. However, when I do docker run busybox, an error is thrown as below.
C:\Users\testuser>docker run -it busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
8ddc19f16526: Pulling fs layer
docker: error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/2b/2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749/data?Expires=1474617209&Signature=HRDYuDqnI3ERPonW9vj0HtP3hzIQoB1j7d-kWzR0iDXozoDknq0n4wIfkw2H73K5xaBBmVNy2ZoOqOQTm9LFP44MGfgS1pNthOLuEMSKrVUJmuaQNvckxuznuqffhkMCmTmQ7-~WMBjyLh7Si9sLdYR8oLVwN6sDRn5wKRa7f4I_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: dial tcp: i/o timeout.
See 'docker run --help'.
The same error occurs for several other images. I do not have a proxy and have a stable internet connection. I have tried this with windows firewall enabled and disabled. I have also restarted the docker service.
Let me know if I am missing something. Thanks in advance.
This is a known issue with the networking stack in the current version of Docker for Windows.
The workaround is detailed in remove stale network adapters: open the Network settings in Docker for Windows, and select the 'Fixed' DNS setting, using Google's DNS server 8.8.8.8.
I was also facing the similar issue while running Docker on Windows 10.
The issue got resolved by changing the DNS settings.
(Settings -> Network -> DNS Server -> 8.8.8.8 ( Automatic)
I observed that when the DNS server option was set to manual, the timeout issue still remains.
After making these changes, Docker service was restarted and I was able to pull the Docker image successfully.
regards,
dattatray.
Simply setting the DNS to fixed (and setting the target to 8.8.8.8) fixed it for me (after Docker restarted).
0
Setting up proxies and changing stale DNS settings were of no use in my case.
I had to reset the Virtual machine using below steps in docker-toolbox bash:
Stop the host docker virtual machine:
$ docker-machine stop default
Delete the host:
$ docker-machine rm default
Create new VirtualBox machine named default:
$ docker-machine create --driver virtualbox default
Verify if the machine is runnning. ACTIVE attribute should be marked *:
$ docker-machine ls
If the machine is not running, run the machine:
$ docker-machine run default
Then, on docker run mysql:8.0, you will get below screen in your bash
Hope it help you guys and save your time!

Docker run connection timeout

While running
sudo docker pull centos
it gives connection time out, While it is running behind proxy where the proxy has been set http_proxy & https_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked LINK but in vain, is there some other settings i am missing please let me know.
2014/11/10 23:31:53 Get https://index.docker.io/v1/repositories/centos/images: dial tcp 162.242.195.84:443: connection timed out
I was getting timeouts on Windows 10 Docker 17.03.0-ce-rc1
To fix it I opened Settings / Network and then set the DNS server to 8.8.8.8
If you are running behind proxy then,
add following command or line in /etc/default/docker file,
export http_proxy=<YOUR_PROXY>
Restart docker service and check,
# service docker restart
service docker stop
HTTP_PROXY=http://proxy_ip:port/ docker -d &
This should work.
On Ubuntu, you can add HTTP_PROXY and HTTPS_PROXY to /etc/default/docker
So yes, what worked for me at the end is setting the proxy, as mentioned by other answers.
I went to icon tray --> Right click on docker to windows --> Go to
settings --> set the proxy as ip:port
Please refer screenshot as below
To change for a fast, open and non-intrusive DNS on CentOS 7:
sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
add the line:
PEERDNS=no
and
sudo vi /etc/resolv.conf
keep only the line:
nameserver 9.9.9.9
If you run into these docker pull timeout issues on Docker Toolbox running on Windows 10 Home and piggybacking off an existing Virtualbox installation, check to see if Virtualbox is separately open and if so, shut down running machines and close Virtualbox (one or more of those running machines within Virtualbox were created and are being leveraged by Docker Toolbox). This heavy-handed way of going about things worked for me
Generally the problem of connection timeout, I know why the internet output was restricted to download docker images from external repositories,
To check this you can try to download the image from another server or another machine with a different internet channel.
If you can send the image from scp use the command: sudo docker save -o /home/your_image.tar your_image_name. and use with this command sudo docker load -i your_image.tar

Resources