What is a container?
A way to package applications with all the necessary dependencies and configurations. The package is portable and easily shared and moved around different computing environments, such as development machines, testing environments, and production servers. The package can be easily shared between the development and operations teams.
Why do we need a container?
Containers allow applications to be more rapidly deployed, patched, or scaled. Containers support agile and DevOps efforts to accelerate development, test, and production cycles.
Containers are used to package and run an application, along with its dependencies, in an isolated, predictable and repeatable way.
Where Do containers live?
The container lives in the container repository. Many companies have private repository. However, there is a public repository for docker containers where you can browse and find any application containers that you need for your code to deploy on a server or machine.
How do Containers improve the development process?
Before containers:
A team of developers developing JavaScript applications then you need PostgreSQL and Redis. Every developer needs to go and install the binaries on their operating system and configure them, run them on their local development environment
The installation process will be different for each operating system.
Also, installing such a system have multiple steps and may occur error. It is a tedious job to install such applications on each Operating system.
After containers:
There is no need to install any services on your OS.
As Containers have their own isolated OS Layer with Linux-based images with packages in one environment.
Hence, for developers, there is no need to go for binaries and run
Instead, the developer needs to find a specific container and download it on your local machine.
The download step is just one docker command which fetches the container and starts it at the same time. Regardless of which OS you are on, the command for the docker command will the same.
If you have 10 application or uses 10 application that your JavaScript application depends on then you just need to run 10 commands for each container and that will be it.
This will make easy to set up your development environment easy and much more efficient than the previous version.
Also, you can run different versions of the same application using docker on your local environment without any conflict.
How containers can improve the deployment process?
Before containers, the development team develop artifacts to install and configure those artifacts. on the server so you have a jar file or something similar for your application, a service and a set of instructions on how to configure, and set it up on the server so the development team would give those artifacts over to the operations team and the operation team will handle setting up the environments to deploy those applications
The problem with this approach is you have to install everything directly on your Operating system which could lead to conflicts.
Another problem could arise when there is a misunderstanding between the development and operations teams because everything is a textual guide so developers miss to mention some important points about configuration if that fails then the operations team needs to go back to the developer and need to ask for more details and this could lead some back-and-forth communication until the application is successfully deployed on the server.
With containers, this process is simplified because Developer and operations team work together for the whole configuration.
Dependencies inside the application just as we saw previously and its already encapsulated in one environment you don’t have to configure any of these on the server so the only thing you need to do is run a docker command that pulls the container that you have stored somewhere in repo and then runs it and that makes the process simplified version.
the only thing, of course, you need to do is you have to prepare you have installed and set up the docker runtime
on the server before you run the containers there but that's just a one-time effort.
That's it for today, I will come up with docker installation and basic commands in the next blog till then Keep Learning and growing. All the best. #Devops #Docker.