Can not run docker command on windows 7 - docker

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.

Related

Docker in WSL2: Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?

I am currently running a Debian Distro (The default one from the Microsoft Store) on WSL 2 and I am having a lot of trouble with running Docker on it. My OS currently is Windows 10 Education Insider Preview, version 2004, and the os build is 19587.1000 and I have Docker Desktop.
Now, at this point, I've literally tried everything. I have tried using the "Expose daemon on tcp://localhost:2375 without TLS" way to no result. Then, I tried enabling "Enable the experimental WSL 2 based engine" (this is also why I had to move to Windows 10 education and get docker desktop and move to this version 2004).
I have also commented out "#export DOCKER_HOST=tcp://localhost:2375" from my .bashrc.
And then since WSL does not support systemd nor systemctl, starting docker using these are useless, and thus I tried "sudo service docker start" and also "sudo /etc/init.d/docker start". But, still when I run any command in Docker in my WSL, it gives me this:
$ docker ps -a
Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?
I just can't seem to figure out what is wrong...
I've looked up everywhere, tutorials, forums, other questions on StackOverFlow.
Most are either about Docker on Native Linux or on WSL 1 where they use the first method of exposing the daemon on tcp://localhost:2375 without TLS which is not very secure, but I didn't even get that working on mine.
Please help! It would be greatly appreciated!!
Thanks in advance!
https://github.com/docker/for-win/issues/5096
Make sure youve upgraded your wsl distro to v2 by checking wsl -l -v in windows powershell
In docker settings, Use the WSL 2 based engine & Enable WSL integration for your distro
But what finally fixed it for me was overriding the DOCKER_HOST env variable left over from using WSL1
export DOCKER_HOST=unix:///var/run/docker.sock
You can execute this line to test and then add it to your .bashrc and make sure its not getting set in .bash_profile or.profile
You should then be able to run docker ps successfully
Ok so basically I installed a clean WSL. This time I got a clean Ubuntu, and somehow it fixed the issue. My other WSL distros still won't work with this, but this clean Ubuntu does. However, as soon as I installed some stuff on it, it started breaking again. Now, I reinstalled it and now it works fine. Seems like something could be potentially conflicting with this?
Okay, I am using WSL2 + Ubuntu + Docker Desktop. What fixed the issue for me waschecking the option "Expose daemon on tcp://localhost:2375 without TLS" in Docker Desktop.
I had a similar issue on Debian, which was strange, as I had a running instance of OpenSUSE connecting to and using docker without problems.
In my case the reported error was
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
WSL2 Integration was enabled for both instances.
What eventually worked was the following:
From within both WSL Debian and WSL.exe - unset DOCKER_HOST
Restart Docker... (right-click on the Docker Dashboard icon in Task Bar)
Try any docker command again or just plain docker ps
There is an option for exposing the daemon on tcp://localhost:2375 without TLS, however it is unchecked by default, and I left it that way.
Enabling virtualization technology in the bios settings worked for me.

Is it possible to run Minikube with VirtualBox on windows 10 along with Docker?

I want to use minikube on Windows 10. I have installed VirtualBox and want to use it as the virtual machine for minikube. Also I installed Docker for windows. But during installation Docker forced to use Hyper-V as default. But that means I can no longer use VirtualBox to run minikube! Not sure what am I missing here.
I have used minikube on Mac and there it was much simpler: simply open VirtualBox and then run command on command line: minikube start . However in Windows 10 it seems much more complicated.
Just to make things clear: Docker requires Hyper-V to be turned on, and Virtualbox requires Hyper-V to be turned off. The reason is they use different virtualization technologies, to be exact - type 1 and type 2 hypervisors:
Type 1 hypervisor: hypervisors run directly on the system hardware – A
“bare metal” embedded hypervisor, Type 2 hypervisor: hypervisors run
on a host operating system that provides virtualization services, such
as I/O device support and memory management.
I've found that there are few approaches to this issue. One of them is adding another boot option and rebooting every time you needed to switch between hypervisors, but it seems that this method is as good as manually turning off Hyper-V, restarting and then using your minikube in VirtualBox. This is probably not the desired state.
So as you can't use them at once, you will have to use a tool that was introduced by Docker for older Windows systems. This is because Docker Toolbox is not using Hyper-V.
Please treat this solution as a workaround, and even Docker does not recommend using Docker toolbox if you can use Docker. Also, you could achieve the same results with minikube running on Hyper-V.
0) Uninstall Docker, turn off Hyper-V, delete all traces of minikube, uninstall VirtualBox (if you tried to run it previously.)
1) Install [Docker Toolbox] - choose full installation2
2) Install Virtualbox, run docker run hello-world inside of Docker Quickstart Terminal and verify if everything is working correctly.
3) Install minikube for Windows (I used chocolatey)
4) Run minikube start.
I've tested this steps, and I was able to run Docker containers in the Docker toolbox in the meantime initializing a Kubernetes cluster in minikube.

Docker inside Windows VirtualBox

here's the thing: I tried to install docker inside a windows which runs inside virtualbox, and off course I failed due it's not possible (now I know this is due Hyper-V not used by virtualbox and required by docker).
Since for me migrating to VMWare ain't an option, I dig a little bit and found out that there's no problem on running docker inside a linux distro (which runs inside a vbox), so here's the question.
Is it possible to run 2 different virtual machines with virtualbox, one with linux (running docker inside it), and the other one with windows as my development environment, both at the same time and to develop on windows and then deploy and run tests on docker? If this is possible, how? Any links or keywords for me to search for would be appreciated.
Sure! You need to do following steps:
You should set your VMs network so then can see easily each other https://superuser.com/questions/119732/how-to-do-networking-between-virtual-machines-in-virtualbox
You should expose docker daemon on TCP socket on VM with linux https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd
On VM with windows you need to create some override for docker client so he will connect to remote daemon on linux machine https://gist.github.com/kekru/4e6d49b4290a4eebc7b597c07eaf61f2#create-bat-file-for-windows
Please keep in mind when you expose some service under ports you won't access that on VM with windows on localhost - instead of that you need to type: :

Run Docker in Windows 10

I'm trying install and runing docker on Windows 10, but I'm stuck in this error,
I'm following these steps
Install Virtual Box
Turn off the Hyper-V
Restart PC
docker-machine create box
Turn on the Hyper-V
Restart PC
docker-machine start box
Error
This is a known VirtualBox bug. Let's try to recover anyway...
Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
I read this github issue e also this one , but still with the same error.
Someone can help me ?
I'm using VirtualBox version 5.2.8-121009-Win
Some commands and results
docker ps
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/containers/json: open //./pipe/docker_engine: O sistema não pode encontrar o arquivo especificado. 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.
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
box - virtualbox Stopped Unknown
docker-machine start box
This is a known VirtualBox bug. Let's try to recover anyway...
Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
Based on your comments above it sounds like you are either following an old tutorial (before Docker for Windows) or following a tutorial for devices which do not meet the requirements for Docker for Windows (i.e. for Windows 10 Home). Given you are turning off Hyper-V I'm going to assume you are using Windows 10 Pro.
The latest version of Docker for Windows does not use the docker-machine command, and will instead create a VM for you in Hyper-V 'behind the scenes'. You should be able to get away with just installing Docker for Windows

Connect to Windows 10 Docker daemon from Ubuntu Bash

I'm trying to do something fairly non-standard, so I'm not sure how successful I'm going to be.
I've installed "Docker for Windows", and I'm able to use it fine from PowerShell.
I would like to be able to use a proper Linux environment though, so I've installed the new Ubuntu Bash prompt for Windows 10.
I've successfully built the latest Docker client in Ubuntu/Bash. However when I run "docker ps", I get:
Cannot connect to the Docker daemon. Is the Docker daemon running on this host?
I had hoped that it might just work.
Is it possible to connect to a Docker daemon running in Windows from Ubuntu/Bash?
I figured it out. It was surprisingly simple. I just had to set the following...
export DOCKER_HOST=tcp://127.0.0.1:2375
This is actually a really cool setup.
A very fast, efficient Docker engine running in a type 2 hypervisor, and a proper Ubuntu-based development environment. Nice :-)
Notice: as #BSalita mentioned in the comment, the Docker service must be running with "Expose daemon on tcp://localhost:2375 without TLS" enabled, which can be found in the general section in Docker Settings (right click on the system tray icon then "Settings..."). This option is not checked by default.

Resources