What is client and server in docker?

balenshah

Member
Joined
Aug 23, 2022
Messages
74
Reaction score
4
Credits
636
comp_subset.png

Docker client is probably docker CLI as written above
Say I've installed Docker in my VM.
Which is server? If the server is my VM, why does it require REST API to communicate with docker client cli?
 


Server and client are ambiguous terms at best these days.

A "server" is typically an application that "serves up" ( gives out ) data.
A web server, a dhcp server, a database server, a virtual machine server, etc...

However you could have a virtual machine running a web server on your main host.
And even though the VM is a client on your host, the web server is still a server per se.

Docker doesn't "require" a REST API, but it depends on how the VM was created.
( Usually with a Dockerfile ). Usually you can access the VM via bash exec.

In the example above, there is a REST API between the Docker server and the docker container,
but usually that is transparent to you, and you can telnet or ssh to your container ( again depending on how
it was created and what services are running inside it ).
 
@dos2unix is absolutely correct.

You can assume docker server as docker engine. Your docker cli communicates with docker engine via docker socket interface.

So whenever you type docker ps or some other command, it is sent to docker engine. Docker engine replies to your command and the result is shown on terminal.

docker <command> ------> docker.socket ------> docker engine
(client) (server)
 

Members online


Top