Life without docker or before docker !!!!
Assume your working with a group of people and you got a requirement to do a certain task the flow would be like the below.
Application dev team will request resources from the operation engineer.
resources are provisioned and handed over to dev team.
dev team will script and tool their deployment.
operation engg and the dev team will do the task repeatedly like code not working or things not working as expected.
dev team noticed some more dependencies.
operation engg will work to install the requested dependencies.
noticed the above steps are repeated.
finally, the app is installed
The conclusion is that dependencies, errors, time-consuming and deployment delays, and additional resources. Nevertheless, the blame game.
Traditional deployment workflow
Docker Container for the rescue
What is the docker and container will be the first question that comes to your mind.
Docker is an open platform for developing, shipping and running application.
Docker helps in shipping, testing and deploying code quickly.
Docker reduces the delay between writing code and running it in prod.
Docker Container Definition
Docker has small images called container with added applications and dependencies everything need to run an application
Docker container is a running instance of image. Docker container can be deleted , move , start , create using docker api or cli
docker automatically checks host OS resources, if any container is not using resources it will deallocate the resources.
The container helps both the team like the dev and operation team, let's see an example
Dev team will build the image
ship the image to the registry and provide configuration info.
the dev team will trigger the application deployment.
Why Containers and why not VM s
Containers are the best example of fast deployment and setup time.
boot-up times are faster
better utilization of the available resources.
Docker Architecture
Docker Daemon
The docker daemon called dockerd listens for docker API requests and manages Docker objects such as images, containers, networks and volumes.
The docker daemon can communicate with another daemon.
Docker Client
If a user enters a command like a docker run, the docker client is responsible for sending the request to dockerd daemon which carries them out ,docker command uses docker API to send back the response to the docker client.
Docker registry
The Docker registry stores the docker images, docker hub is a public registry that can be used by anyone.
Docker is configured to use images from the docker hub by default.
Docker hub you can create a private registry as well.
if you give a command like docker pull or docker run it fetches images from the configured registry.
Docker images
An image is a read-only template with instructions for creating a Docker container.
You build your container image files using another image by adding required software like Apache, java etc.
To build your docker image you create a Dockerfile.
When you change a docker file and rebuild the image only the layer which is changed is built, this makes images lightweight, small and fast when compared to other virtualization like hyper-v, KVM etc .