Your software development process simplified.

Illustration from Iron

One of the downsides of ever-evolving technology is that it’s hard to keep track of them. Especially when we’re in the middle of a project and not all of the team members have the same operating system. Not to mention the implications when that software is going to be largely shared. That makes environment and compatibility issues almost inevitable. Thankfully, there’s a thing called Docker.

Docker

Containers, in the actual sense, let you store and move things from one place to another. Docker containers, on the other hand, allow you to package software with all the parts that it needs (libraries, and other dependencies) so that it can be safely shipped and used in different environments.

Because of this, developers can rest easy knowing that the software can function on other systems besides the one they used for writing and testing the code. Which is a recipe for simpler works and easy maintenance. Sounds cool, right?

How Docker Works

Docker Images

Docker Example

Each of the instructions has different functionality, in the snippet above we see:

  • FROM: Creates a layer from the python:3 docker image
  • ENV: Sets the environment variable PYTHONUNBUFFERED to the value 1
  • WORKDIR: Sets the working directory for the following instructions
  • COPY: Copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>
  • RUN: Executes command in a new layer on top of the base image and commit the results
  • USER: Sets the user name to use when running the image
  • CMD: Provide defaults for an executing container

After creating the dockerfile, the next thing we’ll do is execute it. You can specify a repository and tag at which to save the new image if the build succeeds.

docker build -t <respository> .

Let’s say I want to build the image to justika-umkm-legal with the latest tag.

docker build -t justika-umkm-legal .

After successfully building the image, we can view the image we’ve created by typing:

docker images
Output for ‘docker images’

You can see the image info such as repository name, tag, image ID, the time created, and size. There it is! we’ve managed to make a docker image for our own application to be able to be executed by a container.

Docker Container vs Virtual Machine

Docker Orchestration

My team project’s tech stack

Suppose each of the elements of my project (frontend, backend, database) has been containerized and is later scaled up. In order to keep track and provide well-maintained software, we can’t rely on manual labor alone. This is where docker orchestration comes in as an automation tool to help you sustain your scaled application in case of container failures and accidents.

The tools that are responsible for orchestration are called orchestrators. A couple of those orchestrators that are well-known are Kubernetes and Docker Swarm.

An aspiring UI/UX Designer, also a Junior @ CSUI https://nabilaayu.github.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store