After installation, `docker info` is not working - windows

I installed Dock via chocolatey install docker-toolbox. After installation, docker info is not working.
C:\Users\Chloe>docker info
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/info: 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.
C:\Users\Chloe>docker --version
Docker version 18.03.0-ce, build 0520e24302
https://docs.docker.com/get-started/#test-docker-version
I did run it from an Administrator shell.
Windows 8.1.

Had to run Start > Programs > Docker > Docker Quickstart Terminal which ran a lot of commands. Then in my original Console2 shell, I ran refreshenv. Then docker info would work. (I already had VirtualBox installed (choco install virtualbox).)

Related

Docker for Desktop error during connect: Post A connection attempt failed because the connected party did not properly

I have freshly installed Docker for Desktop Edge in Windows 10 Home and try to build an image using the docker build command. But unfortunately, it didn't work for me, and got the below error :
CMD - docker build -t heet1996/post:0.0.1 .
error during connect: Post https://192.168.99.100:2376/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=na8ugnpn6d8gnxl3z8ppx4gap&shmsize=0&t=heet1996%2Fpost%3A0.0.1&target=&ulimits=null&version=1: 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.
Earlier I was using a docker toolbox so I had to remove all the environment variables related to the Docker in my User variables before installing Docker for Desktop. After a lot of search on GitHub issues, I am still not getting the solution.
This is what I found in my service.txt file (C:\ProgramData\DockerDesktop\service.txt)
[18:27:22.232][LoggingMessageHandler][Info ] [f9b6b957] <Server end> POST http://localhost/dns/refresh-hosts -> 204 NoContent (took 118ms)
I got this error when i un-installed the docker toolbox and installed the docker desktop.
System Configuration:
OS: Windows 10 Home
Version: 21H1
Steps I Followed:
Un-installed the docker desktop.
Removed the all dockers related environment variables from the user variables.
Navigation: This System-> Properties-> Advance System Settings-> Environment Variables-> User Variables.
Re-installed the docker desktop and it's started working properly.
Try to run it on Docker CLI instead of CMD
Open Powershell as Administrator and run the below commands
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
Docker for windows must have:
[✓] Updated Windows 10 version >=2004
[✓] WSL 2 and Default Distro (i.e ubuntu)
The steps are well documented here. These are what to do after the installation:
To confirm ubuntu's installation, open C:/Windows/System32/bash.exe aka bash.
To test if docker is properly installed, run docker version on bash. This should print the docker client and server engine.
After successfully tested and confirmed the installations, try entering your command
$ docker build -t heet1996/post:0.0.1 .
here we are talking about using Docker with PowerShell and not with WSL. And also following the addition of variables in the environment variables of Windows.
Configuration when this response was made:
Windows 10 Pro 20H2 (Build 19042.867)
Docker 20.10.5
Powershell 5.1.19041.610
I also had to configure docker in a dirty way too much, after several hours of research and a comparison of installation on a clean Windows 10 I understood where my error was.
In addition to the user environment variable also make sure that you do not have DOCKER variables in the Windows system environment variables either.
Here is where my error was, I think it was due to the installation of the Docker module
I had the DOCKER_HOST variable in my system variable environment, so i deleted it.
If you want to check all your environment variables with Powershell:
[System.Environment]::GetEnvironmentVariables()
If you really want a Docker fresh installation on Windows, you need to delete the following folders:
C:\ProgramData\Docker
C:\Program Files\Docker\Docker
$HOME\AppData\Local\Docker
$HOME\AppData\Roaming\Docker
$HOME\AppData\Roaming\Docker Desktop
$HOME\.docker
my error, therefore, produced this error:
ERROR ==> error during connect: Get http://docker.artofshell:2376/v1.24/version: dial tcp: lookup docker.artofshell: no such host
After a complete uninstall of all docker (Via chocolatey, official docker ...) and by properly installing Docker from the official executable here everything is back to normal
Then if you want to use docker via Powershell you have to change the configuration of DockerCLI as you can see on many answers
Conclusion
It is possible to use docker with Powershell you must check if the
server daemon is used by Windows/amd64, you can modify the daemon with this command cd "C:\Program Files\Docker\Docker"; .\DockerCli.exe -SwitchDeamon
You can check the configuration of the daemon with the following command: docker version
You must remove all traces of old Docker installations if you had any
You must delete the environment variables from the old installation or from the docker toolbox
You must also activate the experimental features: information here

docker installation on Windows

I have installed Docker in my windows 10 machine.
When i open power-shell and check docker version it shows below
PS C:\Users\XXXXX> docker --version
Docker version 19.03.4, build 9013bf5
But when i ran Docker images or docker run it did not worked
PS C:\Users\XXXXX> docker images
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.
For Docker run
PS C:\Users\XXXX> docker run hello-world
docker : C:\Program Files\Docker\Docker\Resources\bin\docker.exe: error during connect: Post
http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: 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 not getting if docker is installed then why docker images and docker run are not working ?
Make sure the Docker service is runnig.
(1) Go to Services.
(2) Check service Docker for Windows is running.
You can stop/start the service as well using below commands in command prompt.
Net stop com.docker.service
Net start com.docker.service
Refer article : https://success.docker.com/article/docker-for-windows-fails-with-a-daemon-not-running-message
Have you manually started docker after the installation?
Install Docker Desktop on Windows

issue while installing docker for Mac using command line?

I want to install docker using command line not using docker for mac. I have downloaded the individual binary for Mac from this link.
docker ce binaries
I am able to run docker command but if I run docker ps then it shows
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
I tried another way to downloading docker using brew as below
brew cask install docker
But using brew it only download the desktop setup of docker and I have to start it manually.
So I am looking for a solution in which I can install and run docker through command without involving any UI.
Thanks
The error above means that the docker service is not running so you have to run it first. Then enable it to start on boot - to avoid the need to start it each time you login to your macOS - at the end you should be able to use docker cli without issues

cannot run docker on windows 10

hello I just installed docker for windows on a windows 10 computer.
docker run -d -p 8787:8787 rocker/rstudio
gives me:
docker: error during connect: Post
http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.35/containers/create: 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. See 'docker run --help'
What I have done so far:
installed https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
enabled virtualization in the BIOS
made sure that hyper-v is enabled

How do I Debug a Flask app in PyCharm with the Docker for OSX Beta?

I was previously able to debug my Flask application in PyCharm 16.1 with the Docker Machine. I could build the Docker container and then specify it as a remote Python interpreter. I recently upgraded Docker to use the Beta for OSX where it's able to run natively and no longer requires the docker-machine VM. After reading through a related question here: Where is the certificates folder for Docker Beta for Mac I am still having issues when I try and debug.
I have the 2.3.2 Docker plugin for PyCharm and PyCharm build 162.1237.1. It now informs you to run the command
socat TCP-LISTEN:2376,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock
when you try to enter unix:///var/run/docker.sock as the Docker API URL. After doing this (and pointing the URL to tcp://localhost:2376) the server connects to the Docker Beta system and allows u to select an available container image as the remote interpreter. However, when you try and debug the application it gets stuck 'waiting for connection' while connecting to the debugger. In this scenario PyCharm does start the Docker container and if I exec into the container I can run ps aux and see:
python -u /opt/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client 10.0.2.2 --port 61276 --file /opt/project/app.py.
The file /opt/project/app.py is in the container and I can successfully start the flask app by running python /opt/project/app.py. How do I get PyCharm to successfully run this file and connect the debugger so I can step though the code in the IDE, for example.

Resources