Docker Host And Other Fundamental Questions
I am new to Docker. And have few easy questions hope you could help.
I have a windows 10 machine which installed “docker for windows”. In its HyperV manager I could see a virtual machine called “MobyLinuxVM”.
So my questions are:
1, When people talking about “Docker Host” and “Docker Engine”, what are they according to my situation?
— I assume “Docker Host” should be my windows PC, and “Docker Engine” is that Virtual machine inside Hyper-V.
2, If I use ipconfig to see my PC, I will find I got at lease 2 networks and IP addresses:
(a) Lan Adapter -- show my IP is 192.168.xxx.yyy (b) DockerNAT -- show my IP is 10.0.75.1
Then when I try to use dock-compose.yml to create container, I found I could ONLY use:
environment: - MAGENTO_HOST=10.0.75.2 - MARIADB_HOST=10.0.75.2
to create container and can be directly accessed (e.g. via browser to Magento website). So question is:
If my machine is 10.0.75.1 within Docker network, then what is 10.0.75.2? why I cannot use e.g. 10.0.75.3?
3, My yml script actually contains multiple containers creation — e.g. 2 Magento containers + 2 MariaDB containers + etc. When I specify their docker ‘HOST’, why it’s not my machine? (If we call my machine to be ‘docker host’ & hyper-v virtual image to be ‘docker engine’ in my 1st question.)
4, Also according to my 3rd question, I current deploy all containers within 1 host. Is it worth to use Docker Swarm which people can use to cluster multiple Docker hosts? If so, does that mean I need to use Hyper-V to create another “MobyLinuxVM”?
Thanks a lot!
One Solution collect form web for “Docker Host And Other Fundamental Questions”
1 Docker Engine + Docker Host
The Docker Engine is the group of processes that manage Docker containers.
dockerd is usually the head of that process tree.
The Docker Host is the OS running Docker engine, that is MobyLinuxVM
Your VM host is your Windows box.
2 Docker Host IP
10.0.75.2 is most likely the address assigned to MobyLinuxVM. I don’t run Docker for Windows so can’t entirely confirm but searching the web seems to back this up.
3 – see 1
You would need to run multiple VMs to setup swarm. Docker machine is the tool to use when setting up swarm instances. It allows you to manage multiple Docker instances and comes with a HyperV driver.