What is Docker? Why use Docker?

Docker is a software platform that allows you to quickly build, test, and deploy your applications. Docker packages software in standardized units called containers that contain everything necessary for the software to run, including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy applications to any environment, scale applications, and be confident that your code will work.
Features
1-Multiple applications can be installed within the Docker image. An application that will run by default is determined.
2- When we want to create and run a docker container in this image and we do not specify it, the default application will run.
3- However, we can also specify which application will run. So the application we want will work.
4- Although there are multiple applications in the image, we can run a single application in a docker container.
Why use Docker?
Using Docker improves resource utilization, allowing you to ship code faster, standardize application operations, migrate code seamlessly, and save money. With Docker, you have a single object that can run reliably anywhere.
Docker’s simple and easy-to-understand syntax gives you full control. Wide adoption of Docker means that there is a robust ecosystem of tools and applications ready to use with Docker.
Working principle of Docker?

How can docker run containers from images in seconds when it takes so long to copy a file?
Thanks to the Union File System.
For example, if we have an alpine linux kernel, it has linux files such as /bin/etc/lib at the bottom layer. Above this folder is the folder of our application, such as /myapp/hello.sh
In the top layer, we enter a definition. Command line → cmd /myapp/hello.sh
In this way, we can pack all layers together in one. This is what we call a tag. (receptemul/hello-app).
We call image.
In fact, what we call image is a single package of the layers we created on the linux layer.
Images offers a readonly structure.
Container, on the other hand, creates another layer on top of this image and adds a readonly/writeable structure.
Every container has a writable layer and all changes are there
Normally, the union filesystem ensures that they’re all in a single layer, even though they’re a separate layer.
Every change we make on containers is done by this writable layer.
All changes are stored here.

We said that Image is readonly and containers add a writable layer over images.What if we want to make a change in a layer below the writable layer?
Union file system adds this file to the writable layer in the container when we want to make a change to the file in any layer, and hides the file in the image and does not corrupt the original.
For example, when we want to make changes to the /bin/a.txt file in the lowest layer, the a.txt file is copied to the writable layer. (copy on write)
Thanks to the Docker union file system, it provides both speed and flexibility. If he did not create such a structure, both the creation of the container would take seconds to minutes and the copying process would be more difficult. It would also take up more space. Another advantage is that while docker copies these images, it does not create the layers created differently each time. It keeps it as one in one place.

Thank you for reading!
Resources
https://opensource.com/resources/what-docker