This post explains docker so well and simply. Providing this for reference for anyone who wants to get an understanding...:
From what I understood, it's a virtual machine (like VirtualBox I guess?) but that only uses ressources that you need.
It's not a virtual machine, but it solves some of the same problems a virtual machine can solve.
Let's say I want to run software Foo on my computer. Foo requires PHP 8. OK. I install PHP 8 and run my software. Later, I want to also run software Bar on my computer. Bar requires PHP 7. I have a problem now. These two pieces of software need different versions of PHP to work. In most cases, you can't install multiple versions of the same software without major problems. (If there's an easy way to have multiple versions of PHP, then pretend it's a different library or dependency)
One way to solve this is with virtual machines. Have one virtual machine with Foo and PHP 8 and another with Bar and PHP 7. You've used virtual machines to
isolate the environments of Foo and Bar. Done.
But this is inefficient. Each virtual machine requires its own operating system. You're now running the host operating system, Foo, Bar, and two more operating systems. What if there was a way to isolate the environments of Foo and Bar, but not have to run two extra operating systems?
That is what Docker does. Whenever a program wants to know anything about the system it's running on, it has to ask the operating system for that information. What does the network look like? What does the file system look like? How much memory is there? What other programs are running? A running program must ask the operating system for this information.
Normally, Foo and Bar would be able to ask the operating system, "What other processes are running?" Foo would see Bar, and Bar would see Foo. If they asked, "What does the file system look like?" both would get the same answer. What if we configured the operating system to lie? When Foo asks what other programs are running, we tell it no other programs are running. When Foo asks about the file system, it doesn't see the real file system, it only sees a part of the file system with exactly what it needs to run. By strategically lying to Foo and Bar, we can isolate their environments without having to run virtual machines and extra operating systems.
This strategy is called "containerization" or "running software in containers". Docker is a set of tools used to create and run containers.