My Docker Notes 1703107241
My Docker Notes 1703107241
Docker is an open platform that provides us the ability to run our applications in
an isolated env called containers.
For eg. There is an app that requires MySql, Redis. In order to run it one has to
install all these dependencies in their machine. Here is where docker comes into
the play. A docker container running on the docker engine will set up all these
configurations in a virtual env into which the app can run.
A docker image is the actual package, the software application along with its
configurations that can be shared from one machine to another. A container is a
running env of an image.
A OS has 2 major layers, The Kernel that interacts with the hardware and the
applications layer that interacts with the Kernel.
Docker 1
In VM, the Virtual Machine image contains its own Application layer and Kernel
and directly connects with the H/W.
Docker virtualizes at the Applications layer level. All the containers share the
Kernal of the host OS.
We can create our own network in docker, sudo docker network create --driver
<driver-name> <network-name>
Containers on the default bridge network can only access each other by IP
addresses.
Docker 2
Bridge network mybridge
Docker 3
Odin and Loki are in user-defined bridge network, Asgard
Host network driver allows the container to sit at host level. We don’t have to
expose the ports too.
1. MACVLAN where each container gets its own MAC address and IP address.
2. IPVLAN L2 - containers share the MAC address of the host but have their own
IP Address.
Docker 4
Docker volumes are stored in the physical/host machine and on container startup,
they are copied into them.
Docker 5