Docker

As a MERN developer, I specialize in building web applications using the MERN stack, which includes MongoDB, Express.js, React.js, and Node.js. With extensive skills in developing scalable and robust web applications, I am committed to delivering high-quality solutions that meet the needs of my clients.
Introduction
Docker is an environment for developing, shipping and running an application in containers. Docker provides a way to create, deploy, and manage containers efficiently, making it easier to build and deploy software across different environments consistently.
WSL
WSL stands for Windows Subsystem for Linux. It provides an environment that allows us to run Linux tools and programs inside Windows. Once you install WSL, which provides us with a bash terminal, where we can run Linux commands within our Windows OS.
Steps to enable WSL in Windows:
Go to the "Windows turn feature off and on" section in your system.
Tick on Windows Subsystem for Linux and save.
Then Restart your PC.
After restarting Windows go to Microsoft Store and install one of the Linux App (e.g.: Ubuntu 22.0 LTS)
After installing then open open it. If any error occurs then follow the instructions shown
Then set up your Linux system username and password. (Note username and password should not coincide with your Windows username or password)
Then enjoy your Linux subsystem inside Windows.
After setting up WSL you can install docker from bash otherwise you can download docker desktop directly into your system.
Containers
It is a way to package an application with all the necessary dependencies and configuration. These packages can be easily shared and moved between development teams.
This package of containers makes the development environment more efficient.
Where do containers live?
Containers live in the container repository. So it is a special type of storage for containers.
Many companies have their own repository which is known as a private repository.
There is also a public repository for the docker. Docker Hub is a public repository for docker.
How do containers improve development?
Before docker to develop an application with multiple teams. They run their application on different machine, the services required to set up an environment for the application is also different and there are many steps to set up an application environment which is reduced by containerized concept. Manual setup for an application can be very tedious and time-consuming resulting in loss of time and effort.
After Docker, you do not have to install any services or dependencies manually on your local machine. Because the container has its own isolated environment. With a based image that provides an isolated environment with everything packaged. Rather developer go and install services for application, developer checks containers to find specific container and download on his local machine.
How container environment help in the deployment process?
Before Container
Configuration on the server needed
Conflicts may occur in dependency version
Misunderstanding between developer and operation team
The developer needs to mention the operation of the configuration.
After Container
Developers and operations work together to package applications in a container
No environmental configuration is needed on the server except docker runtime
The only thing you need to do is to run docker command. So it is a one-time effort.
Docker Image vs Docker Container
| Docker Image | Docker Container |
| Actual package | Actually, start the application |
| Artifact that can be moved around | A container environment is created. |
| Image run on container | It is a running environment for image |



