Docker is a tool running applications in an isolated environment.
Docker offers advantages similar to running your application inside a virtual machine.
Docker advantages are always running same environment, sandbox project, works out-of-the-box
Same Environment: Your application always runs exactly the same environment so you don’t get any inconsistencies in how it behaves.
Sandbox Project: If you’re working on multiple projects, it lets you sandbox/separate each one. It’s good for security and eliminate potential conflicts between different projects.
Just works: It makes it easier to get going with somebody else’s projects. You don’t have to install all of the tools and dependencies that the project needs.
What is the difference between Virtual Machine and Docker setup?
Docker achieves this by running container that contains operating system, configuration and code. However, it’s not a full virtual machine (VM).
Virtual Machine Setup: Server >> Host OS >> Hypervisor >> Virtual Machine (Kernel >> bins/libs >> App)
Docker Setup: Server >> Host OS >> Docker (bins/libs >> App)
As a result, container can startup in seconds, consumes less disk space and memory to run compared to VM.
Container is a running instance of an image.
Image is a template to create the environment which is similar to “Windows Backup and Restore”.
All of the Operating System, Software, Application Code are bundled up in a file known as image.
Image are defined by a docker file. Dockerfile is a textfile with a list of steps to perform to create that image. Example of the steps are configuring operating system, installing the software, copy the project files into the right folders, etc