Unable to pull images no such host on Windows - windows

I tried to build a docker file on Windows OS. But i got this instead.
muhammad.iqbal#IQBAL MINGW64 /d/DockerTest
$ docker build .
Sending build context to Docker daemon 73.36 MB
Step 1/3 : FROM php:7.1.27-apache
Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: no such host
I have tried to restart and relaunch docker application but nothings change.
i have read this and this. but it's on LInux OS, but how to do it on Windows OS.
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: no such host
lookup registry-1.docker.io: no such host

Okay so just like Pierre B. comment, at the time of that issue, i was using my office's VPN. So it's pretty simple, just turn of the VPN and tried to pull it again.
But i don't know what's the reason unable to pull any images when i am using the office's VPN.

Related

Why is Podman trying to pull an image that already exists after loading from file?

I am working in an air-gapped environment running Fedora CoreOS which comes packaged with Podman. I have several container images I have been working on transporting into the air-gapped environment. In order to do this I have followed these steps:
I acquired the images on a machine with internet access. Some of the images were pulled into Podman from my Docker registry using podman pull docker-daemon:docker.io/my-example-image:latest while some were pulled directly from the online repositories using podman pull.
I saved the images to a tar file using (for example) podman save docker.io/my-example-image:latest -o my-example-image.tar
I transported the tar files to the air-gapped environment on physical media and loaded them using podman load -i my-example-image.tar
When I check the images using podman images they all appear in the images list. However, if I try to run a container from one of these images, using sudo podman run docker.io/my-example-image I get a long error message:
Trying to pull docker.io/my-example-image
Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1}:53: read udp [::1]:50762 ->
[::1]:53: read: connection refused
Error: unable to pull docker.io/my-example-image: Error initializing source docker://my-example-image:latest:
error pinging docker registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp: lookup
registry-1.docker.io on [::1]:53: read udp [::1]50762 -> [::1]:53: read: connection refused
I get a similar message for images that were acquired from other repositories like quay.io
It seems to me that the error is caused by the machine's inability to establish a connection with a registry, which makes sense to me considering that the environment is air-gapped. But I am not sure why podman is even trying to pull these images when they already exist in the environment as confirmed by podman images
I have tried using various ways of referencing the image within the podman run command including
sudo podman run docker.io/my-example-image:latest
sudo podman run my-example-image
sudo podman run my-example-image:latest
I have tried searching for a solution to this problem to no avail and would very much appreciate any guidance on this.
Each user has its own container storage.
The user root uses the directory /var/lib/containers/
Normal users use the directory ~/.local/share/containers/
The command
podman load -i my-example-image.tar
will use the directory ~/.local/share/containers/
The command
sudo podman run docker.io/my-example-image
will use the directory /var/lib/containers
If you would like to share a read-only container storage between users,
check out the setting additionalimagestores in the file storage.conf
[storage.options]
additionalimagestores = [ "/var/lib/mycontainers",]
Reference:
https://www.redhat.com/sysadmin/image-stores-podman

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

Docker Installation Error on Windows behind Firewall

I'm trying to install Docker on a Windows computer but I get this message:
Running pre-create checks...
(default) No default Boot2Docker ISO found locally, downloading the latest release...
Error with pre-create check: "Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 192.30.252.124:443: 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."
Looks like something went wrong in step 'Checking if machine default exists'...
Press any key to continue...
Any suggestions on how to resolve this?
Editing the start.sh file may come up with other error things.
Instead that, just put your boot2docker.iso in below location as.
c:\user\USERNAME\\.docker\machine\cache
and restart your Docker terminal.
You may behind a firewall. If so, you will need to configure an http proxy.
According to https://github.com/boot2docker/boot2docker-cli/issues/230 you can do this one of a couple of ways:
(1) Edit start.sh and add the following before boot2docker.exe is called
export HTTP_PROXY=<proxy>
export HTTPS_PROXY=<proxy>
(2) Add HTTP_PROXY and HTTPS_PROXY (and their values) to your System Variables or User Variables in your Windows config.
The proxy value should be of the form http://hostname:port

Types of errors docker in Windows?

When I began to start docker it stuck and there are so many bad problem with it
System: Windows 8.1 64-bit
I replace virtualbox 5.0.6 to virtualbox 5.0.7 Still, there's an error
Error One:
When Docker Quickstart Terminal want to begin Starting VM... is hanging
Error two
I test my installation with docker run hello-world I get the following:
Post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Error three
Kinematic doesn't work
It work until 99% BUT suddenly it doesn't work
Machine IP could not be fetched. Please retry the setup. If this fails please file a ticket on our GitHub repo.
Best solution I've found after googling for a while:
First check if your Virtualbox version is the latest or at least above 5, then
Run on CMD docker-machine rm -f ##dockerContainerName## (Generally: default)
Delete .docker folder from your user folder
Run docker-machine create --driver virtualbox ##dockerContainerName##
Profit!!!

Perforce installation in network folder for Windows

I would like to install the Windows version of Perforce in a network location so that users can call p4 via:
\\somewhere\p4.exe -p server:1666 -c some_client_name sync
where "somewhere" is consistently mapped on all Windows machines. I tried to do this by installing locally, then copying p4.exe to \\somewhere.
On the computer where I installed locally, \\somewhere\p4.exe works just fine. But when I switch to another machine and try to run
\\somewhere\p4.exe -p server:1666 info
I get the following error:
Perforce client error
Connect to server failed; check $P4PORT.
TCP connect to server:1666 failed.
A non-recoverable error occurred during a database lookup.
What does this error mean? I couldn't find any information in the documentation; I suspect I might need another file besides p4.exe. Indeed, when I install Perforce locally on the other machine, using the local p4.exe works, but \\somewhere\p4.exe still does not.
Any pointers?
Thanks!
You shouldn't need any other files besides P4.exe.
The TCP connection error is probably because that other machine isn't able to translate "server" into an IP address.
Try using some of the Windows command line tools to diagnose this, as in:
nslookup server
or
ping server
Also, try changing your test to run:
\\somewhere\p4.exe -p NNN.NNN.NNN.NNN:1666 info
where the "NNN.NNN.NNN.NNN" is the IP address of your server machine.

Resources