Docker notes

Thalapathy Krishnamurthy
2 min readDec 20, 2019

--

I had to do docker recently for a Java app I have been writing.

I used to think it is like one of those build and packaging tools out there to help you through your build-deploy-iterate loop.

But after going through it, in simple terms, it allows you to run your software which comprises of the OS,library,virtual machine, file system dependencies into any machine, be it development, test or production seamlessly.

By dockerizing you are dropping your application comprising all dependencies into a virtual environment. This virtual environment is now your application image. And this image can be dropped on any machine and you can run it with a single command.

You can create any virtual environment by stacking pre-built images. For example, you can choose to stack a Ubuntu image at the bottom for your OS, a JVM on top of it, then run some commands to fill up with a bunch of Java libraries from a Maven repository your Java application needs and then run your actual Java application on top of this image. You can rebuild your stack of images in no time by modifying the instructions in the Docker file.

The real beauty of this setup is, previously when you had shell scripts to setup your application in development, test or production machines and suppose you had to bring in a new version of library or you are running on a different OS in production than your Development, it becomes so hard. You have to dabble with your install scripts. In Docker, it is a bunch of straight commands.

Because, they operate at an image level and allow stacking of images, it is like slices of bread you layer to create your own environment where your application runs. And any change to this stack, is a simple re-run of the Docker command and Voila! you get a new environment for your App you can simply drop on any machine and create numerous instances of them.

This is the basic idea of it. There seem to be more to it when it comes to auto-scaling across a distributed micro services architecture along with Kubernetes.

I still do not know how this affects the performance of your application. There is no free lunch in software. If you ease something, something else becomes hard.

--

--

Thalapathy Krishnamurthy
Thalapathy Krishnamurthy

No responses yet