Do you remember your first software development project? How about your initial task? It was probably setting up the environment in the local machine. It seemed like it took forever to configure the operating system, install the database, the programming language framework, and other software dependencies. It seems like it took a long time, but the truth is it took most developers 2-3 days just to set up the local environment, let alone everything else.
With the software development process come to a lot of challenges, sometimes the application works just fine on your local machine, but does not work on other machines, or breaks down during production. The environment disparity is most often the culprit. Although this has become a common problem during the software project, we do not want you or your team to experience these inconveniences.
Here’s What You Do
During the past five years, Docker has made the development process more efficient and predictable. Docker is enabling developers to easily pack, ship and run applications the same way in all environments.
Deployment is the most expensive aspects of the software development process because it requires different technology stacks such as VMs, configuration and package management tool, and dependencies manager. By using Docker, you can simplify the development process by building mundane tasks once and repeating the same configurations across the entire delivery environment. Before Docker, we built code the traditional way and shipped it to the upper environment that might have different platforms and technology stacks. However, with Docker, you can ship the code and the whole stack including operating system, application server, other software required and the code itself all at the same time. Since the code, dependencies, and configurations are the same, it will work on your machine, your friend’s machine, a staging machine, or even during production. This makes releasing software much easier and enables a consistent environment.
It is also possible to set up local development environments that are identical to live production servers. By Dockerizing your local development environment, it will be easier to perform testing or reproduce and investigate issues that may have occurred during production.
You can reduce the amount of time it takes to set up a local development environment. For example, early in the process, if you are planning to develop a Java web application and use PostgreSQL as a database engine, you will need to install and configure the database first. Generally, you will have to download the DB installer, install it to your machine, customize the configuration, and populate a prerequisite database, users, and initial data. This is extremely time-consuming. With Docker, you just pull the PostgreSQL Docker image from your repository and run it in seconds. It is that simple, and now you have a Postgres server running with the same production settings.
Let’s take a look at a real situation. We will assume that you are using the following technology stack on your software project.
As a frontend developer, you might not be familiar with the Java world. To run the backend application in your local, you do not need to install the Java runtime (JDK), other Java libraries, and the Postgres DB engine, you only need to have a Docker engine. This will save time and effort for the frontend developers since you are focusing on the frontend.
As with the backend developer, you do not need to have NodeJs and other frontend libraries on your machine to run the frontend stack, you only need a Docker engine.
How to Get Started with Docker?
To Dockerize the stack (DB, backend, and frontend) you must be familiar with the Docker concept and basic command such as:
- Docker Build
- Docker Push/Pull
- Docker Run/Stop
A Docker file will be used to define the inside of the server. Once you have a Docker file, you can build a Docker image and push it to a Docker repository where other developers can use it. In addition, if there is an update on the Docker file, such as a configuration change or an initial data change, you can rebuild the image and push it to the repository. Then other developers can pull the image from their machine to get the update.
In conclusion, Docker enables developers to set up local development environments that are identical to the live server with minimum effort. This enables an easy software release and a consistent environment. You will experience improved software development, application deployment, and business agility.
Achmad Fajar Ridwan – Analyst