Docker does not have default machine in Windows 10 - docker

I installed Docker in Windows 10 64bit. The built is also correct and it is a pro version so it shouldn't be a problem.
Docker activated Hyper-V and created the docker machine, which I can access to load page in localhost. The syncing is also working so my Docker container is working overall (I used Laradock).
My problem is when I try to connect to the MySQL from my host machine, I can't connect through localhost or 127.0.0.1. Ports are correct too I have checked.
Amendment: If I leave the host box blank, PhpMyAdmin works. But I
still can't connet through SQLYog or other clients.
I tried doing docker-machine ip and I get this:
Error: No machine name(s) specified and no "default" machine exists.
Here's my docker ps output:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
85cce33afbe2 laradock_nginx "nginx" 12 minutes ago Up 12 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp laradock_nginx_1
f2ce18b4591c laradock_php-fpm "php-fpm" 12 minutes ago Up 12 minutes 9000/tcp laradock_php-fpm_1
23bf95305334 laradock_workspace "/sbin/my_init" 12 minutes ago Up 12 minutes 0.0.0.0:2222->22/tcp laradock_workspace_1
f7b87216173b laradock_phpmyadmin "/run.sh phpmyadmin" 12 minutes ago Up 12 minutes 0.0.0.0:8080->80/tcp laradock_phpmyadmin_1
4a87449e2bb6 laradock_mysql "docker-entrypoint.sh" 12 minutes ago Up 12 minutes 3306/tcp, 0.0.0.0:3306->1234/tcp laradock_mysql_1
After the fix:
I am still not getting the 'default' machine and can't do
docker-machine ip but by changing the port mapping from 1234 to 3306
I got SQLYog to work too. It'll do for me for now.
So I mapped opposite. I have to map to 3306 from 1234 which means I have to do "1234:3306" in my docker-compose.yml file. That worked too. :D
The discussion below, fixed my problem but I can still use some solution to why 'default' machine is not working and I can't do docker-machine ip.

VirtualBox VMs created with docker-machine (including the default one typically created during Toolbox install) will no longer start. These VMs cannot be used side-by-side with Docker for Windows.
Docker for Windows
You don't use docker-machine. You list the containers with docker ps. If you cannot access the MySQL container, then you might have forgotten to expose the port.
My problem is when I try to connect to the MySQL from my host machine, I can't connect through localhost or 127.0.0.1.
Sounds like you're connecting wrong. It is definitely running.
4a87449e2bb6 laradock_mysql "docker-entrypoint.sh" 12 minutes ago Up 12 minutes 3306/tcp, 0.0.0.0:3306->1234/tcp
Though, unclear why you mapped to port 1234

Related

FATA[0168] [network] Can't access KubeAPI port [6443] on Control Plane host

I am trying to setup an RKE cluster with a config file. I have 4 virtual machines docker, docker.io are installed. Ufw is disabled, have done everything as here .
I connect via SSH,
can connect succesfully with root and home user which I added to docker group.
I clean all the machines, stopping dockers, remove volumes and images and remove files created under /etc, /var etc. I keep getting same error. As I said above, ufw is disabled and inactive and netstat gives me this when installing.
In docker ps I get
c8c00552f6bb rancher/rke-tools:v0.1.78 "/docker-entrypoint.…"
About a minute ago Up About a minute 80/tcp,
0.0.0.0:6443->1337/tcp rke-cp-port-listener
Netstat:
tcp 0 0 0.0.0.0:6443 0.0.0.0:*
LISTEN 7171/docker-proxy
I did this and nothing changed. I clean machines everytime I try another solution and it costs time. Any help is great now. Thanks.

Windows 10 Docker Container Connection

I am trying to run docker on windows 10, installation worked fine. Now I am running few containers like below.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7a86a28e4116 data-extractor_php-fpm "/usr/sbin/php-fpm7.…" About an hour ago Up 29 minutes 9000/tcp data-extractor-php-fpm
09105815a3c4 nginx:alpine "nginx -g 'daemon of…" About an hour ago Up 29 minutes 0.0.0.0:6000->80/tcp data-extractor-webserver
The nginx container is running, But may I know, how to connect to this container from browser,
normally on mac it works like below
http://localhost:6000/
May I know how to access this container in wondows 10?
Yes, found the answer by myself. It appears to be chrome issue, chrome refusing to connect to port 6000 throwing error like unsafe port, either change settings in browser or update compose file to use allowed ports by chrome, and second step will be to update hosts file map docker machine ip to localhost. Docker ip can tracable by using following command.
ipconfig
hope it helps others.

Why docker container status in hyper-v virtual machine not correct?

The whole story:
Usually I use docker ps to check container status to see if any restart of container.
Recently, I setup one hyper-v machine in windows10, also install ubuntu18.04 in this hyper-v machine. Meanwhile I install docker in this ubuntu18.04.
I new some containers in this ubuntu18.04, then I directly shutdown the windows10 pc before go to sleep.
Later some day, when I remember this thing again I start the win10 pc, ssh to this virutual machine & did next:
cake#cake:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0ac07c24c537 wordpress "docker-entrypoint.s…" 5 days ago Up 5 days 0.0.0.0:8080->80/tcp gg_wordpress_1
3c47669c927f mysql:5.7 "docker-entrypoint.s…" 5 days ago Up 5 days 3306/tcp, 33060/tcp gg_db_1
Problem:
You could see the containers created 5 days ago which is ok, but the STATUS shown the containers are already up for 5 days.
I'm sure I have close the windows10 pc during this 5 days, meanwhile after find above thing I also reshutdown win10 to check if 8080 of one container service could be accessed?(The result is sure that it could not be accessed). Then I restart the win10 pc, execute docker ps again, I suppose the STATUS is something like 1 second ago, but still 5 days ago.
NOTE: don't suggest docker for windows with MobyLinuxVM in hyperv, I just want to know why my issue happen.
UPDATE:
As I said in comments:
If execute uptime in bash, it will show : 20:57:41 up 1 day, 2:23, 1 user, load average: 0.00, 0.00, 0.00
I there is one situation could explain this: pause the hyper-v. This will make the VM pause, meanwhile uptime stop to count, but docker ps still not stop to count, it just count the real time. Not sure why.
So, my situation could be next:
a) 5 days ago, I start the containers.
b) 4 days ago, I pause the VM (Not sure, maybe other operation similar)
c) Just now, for some operation not sure, the VM unpaused.
d) Then, I could with uptime see the VM start for 1 day; but with docker ps still see the container up for 5 days.
e) During these five days, I certainly not shutdown the VM; I just not only once shutdown windows10 physical machine. But it seems not affect the time counter for virtual linux machine.
So, it seems directly shutdown win10 machine not affect time counter of hyper-v linux virtual machine.
Another word: if by pass VM pause, if we directly shutdown win10. Then, although the service in hyper-v VM also interrupte, but when win10 & hyper-v VM linux back, the VM just behave like never stop, the uptime also counter during the stop period of hyper-v VM. Seems now narrow down my issue to this hyper-v behavior.
Anyone could explain this hyper-v behavior?

How to access the application(exposed on port 7600) from docker container inside a container?

I have a Jenkins docker container running on a ec2(Amazon linux AMI) and i am able to access the jenkins container with IP:PORT on web browser.
[#~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
74db49830336 jenkins_1 "/sbin/tini -- /usr/…" 5 hours ago Up 5 hours 50000/tcp, 0.0.0.0:80->8080/tcp jenkins_1
I have created a job which will create container inside Jenkins container and which is exposed on port 7600
jenkins#74db49830336:/# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b4527d9ef554 cloudwaveapp_10 "runaceserver" 56 minutes ago Up 54 minutes 0.0.0.0:7600->7600/tcp, 0.0.0.0:7800->7800/tcp, 0.0.0.0:7843->7843/tcp, 9483/tcp cloudwave1
i have added(exposed) all the ports in EC2 Instance inbound rules
Issue:- I am not able to access the IP:7600 on web browser.
To map this port you need -p 7600:7600 when starting Jenkins container. So you kind of mapping the inside ports to outer system (think of onion).
Anyway - this is bad idea to run container in container. You can achieve the same when having shared volumes/network for communication. Container in container provide bigger mental load and you need to mount extra devices to the first Jenkins container.

Docker espeakbox: What do I do now?

Seems real simple, but I'm not sure what to do now. I have docker on OSX and I'm want to try out espeakbox. So I ran
the command mentioned here.
to "run a container"
It's evidently running:
bash-3.2$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
705a605786c7 parente/espeakbox "/server" 34 seconds ago Up 33 seconds 0.0.0.0:8080->8080/tcp espeakbox
So, what do I do now, to use see it, hear it, etc.
Thanks.
There's full instructions on the GitHub page, so I'm loath to answer this question. However, I'm assuming the confusion is that you're not sure where the container is running. If you're using boot2docker, Just do:
$ curl http://$(boot2docker ip):8080/speech?text=hello
I assume it sends back an mp3 file.
Basically, the docker run command told Docker to forward port 8080 on the container to port 8080 on the host. When using boot2docker, the host is a Virtualbox VM, so we need to use the IP of the VM to connect to the service.

Resources