Docker Not pulling images from the Docker Hub on Mac OS - docker

After installing Docker Desktop on Mac OS,
I can run commands like docker ps.
But I can't run docker run hello-world or docker-compose up.
Here is the Error message!
Unable to find image 'docker/getting-started:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: Service Unavailable.
See 'docker run --help'.**
I've tried
installing and uninstalling Docker Desktop
restarting my Mac OS

After trying different things, here is the answer for Mac OS users!
Run this command.
docker info | grep Proxy
You'll get the similar result like below.
HTTP Proxy: http.xxxx.xxxx:1278
HTTPS Proxy: http.xxxx.xxxx:1278
Go to the Docker Desktop setting >> Resources >> Proxies. Then, turn on manual proxy configuration.
Put your HTTP Proxy as above. http.xxxx.xxxx:1278
But put "s" in your HTTPS Proxy as https.xxxx.xxxx:1278
And then click "Apply&Restart". The problem is solved!

Related

Unable to pull any image from Docker public repository

I am unable to pull any image from the Docker public repository.
Until yesterday, everything was OK.
Nothing had changed in my network configuration.
No VPN, no proxy, working at home - connection at 540 Mbps according to fast.com.
I am using docker engine on Ubuntu 22.04 running inside WSL
Host Operating System:
Windows 11 Professionnal - Version 22H2 - Build 22621.819
$ docker -v
Docker version 20.10.19, build d85ef84
I have tried:
changed the default DNS to dns_google (8.8.8.8)
restarted the docker demon
restarted WSL
restarted the computer
connected to the internet on another network (4G)
flushed the DNS info locally (ipconfig /flushdns on Windows CMD)
searched for any reports of unavailability, change of rules on docker official site.
I was expecting the image to be downloaded to my local computer to be used by docker,
but I got this:
$ docker pull hello-world
Using default tag: latest
Error response from daemon:
Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on <my_ip>:53: read udp <my_ip>:42896-><my_ip>:53: read: connection refused

Docker Desktop for windows + WSL2 (ubuntu) ( on Win10 PRO) problems with proxy

I'm trying to connect docker with my corporate proxy. Tried many and many things across the internet, and nothing works.
I'm running docker on windows 10 pro edition and a ubuntu 20.04 lts on WSL2. The manual configuration on docker desktop seems to be not effective at all, it does nothing!
Running the simple image
Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": Proxy Authentication Required. See 'docker run --help'.
I really tried everything i could find on internet, literally! Please help!
i treid to change every config file on several tutorials out there, but no sucess

Connection error when running docker commands

On running docker images, I am getting error
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/images/json:
open //./pipe/docker_engine: The system cannot find the file specified.
In the default daemon configuration on Windows, the docker client must be
run elevated to connect. This error may also indicate that the docker
daemon is not running.
I am on Windows 10 Home and have tried to install/reinstall Docker but I keep getting the error. Things were working fine an hour back!
Can you check if you have a VM running under docker-machine? You can run the below command:
docker-machine ls
And if you haven't installed docker-machine, please install it.
Ref:- https://docs.docker.com/toolbox/toolbox_install_windows/
Note:- Make sure enabled the BIOS virtualization.

Dependencies to connect to a remote docker container in VSCode?

What are the dependencies and steps to connect to a remote docker container from VSCode? So I can properly compile and run the code with the tools in my container environment?
I have tried to follow the instructions here without much luck:
https://code.visualstudio.com/docs/remote/containers-advanced#_developing-inside-a-container-on-a-remote-docker-host
My setup involves:
Host with VSCode, no docker installed, ssh client installed, ssh keys are in place
Server with VSCode, docker installed, ssh client and server installed
Docker container already running on Server
Host can connect to Server, through VSCode using the Remote Development Version: 0.17.0 extension, through Remote - SSH Version: 0.47.2 extension
Version: 0.47.2
Server can connect to Docker container, through VSCode using the Remote Development Version: 0.17.0 extension, through Remote - Containers Version: 0.83.1 extension.
How do I connect Host to a Running Docker container?
UPDATE 1
Small advance
I have added this line to my ~/.config/Code/User/settings.json file. The option gets highlighed with a message unknown configuration setting
{
...
"docker.host":"tcp://localhost:23750",
...
}
Run this command in another terminal:
ssh -N -L localhost:23750:/var/run/docker.sock <user>#<serveraddr>
And now I can see the running containers in Remote explorer > Containers > Other Containers. However, when trying to connect to it, I get the following error message.
Setting up container with bc1700db049858ba20f1c830bbeff6d6a4e04de58a2b35a61df1016788bc07db
Docker returned an error code 127, signal null, message: Command failed: docker system info
/bin/sh: docker: command not found
So, it appears that docker must be installed on the host machine to prevent the last mentioned error.
Note: docker service does not need to be running in the host (systemctl disable docker)
With this in mind, these are the steps.
Host:
Install docker and ssh client
Add your user to docker group
Install VSCode
Configure Server
(After server config below): edit ~/.config/Code/User/settings.json with
"docker.host":"tcp://localhost:23750",
Configure your ssh keys for the Server
(After every reboot run on terminal: ssh -N -L localhost:23750:/var/run/docker.sock <user>#<serveraddr>)
Run VSCode and install Remote Development extension. Restart VSCode
Now you should see your running containers in VSCode Remote explorer > Containers > Other Containers
Server:
Install docker and ssh server
Install VSCode (this may not be a requirement on the server)
Add your user to docker group and start your container
I realize this was already answered, but I stumbled across this while trying to set this up myself today. I found an additional issue I had appeared to be that my local SSH key had not been added to the agent. I was following the instructions here.
I am running Windows 10 Version 1909 Build 18363.1082.
After doing an ssh-add $Env:USERPROFILE\.ssh\id_rsa and restarting the ssh-agent, I was able to connect to the remote container without having to employ the ssh tunneling method you show above.

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!

Resources