Introduction to Docker


Deploying applications is a complex task. You have to create some VMs, be it on DigitalOcean or AWS, download and install necessary prerequesites and then deploy your application. It would be easy if it were to end there, however, it doesn’t.

Following this you have application maintenance which includes deploying updated versions of your application in addition to other things like bug fixes. And this is where the real complexity starts. Your updated version might need another dependent application to be installed which in turn might need a version of some random tool to be upgraded. You did what was necessary but then you find out that the deployment of the updated application failed because you forgot to do that one null check in some corner of your application. So frantically you download the previous version of your application and try to restore it only to find that it doesn’t work anymore since you upgraded that random tool to support your newer application.

While all this is happening either your entire application is unavailable because your application is single instance or if it is indeed multi-instance split by a loadbalancer, all the other instances are being stressed out because one of the node is down.

And now you are thinking. Well, there has to be a better way.

Well my friend, there is.

Continue reading →

Deploying single instance WordPress site on CoreOS


Lets start off by deploying a single MySQL DB instance. For this, we’re going to use the default mysql image from docker hub. In order to deploy anything to CoreOS, you need to first create a service file. Here’s one for the MySQL that we’re going to deploy.

Save that file as wpdb.service. Lets examine that file. As you can see, the file is split into three distinct sections. Unit, Service and X-Fleet. The Unit section tells CoreOS, or more specifically fleet, what this service is about and what it is for. Since this one is quite simple, we only have a Description here.Continue reading →

Some quick tomcat shell functions

Here are some bash profile functions to help you use tomcat as a pro. The following needs to be done in either your .profile file or .bash_profile, depending on what shell you have and whichever method you prefer. First off, make sure you have exported CATALINA_HOME variable pointing to the base of your tomcat installation.

Once you’ve got that done, you can define the following shell functions.Continue reading →

Some docker helper commands

So a lot of times when you’re working with some cool docker containers, you might need to remove all those dead containers that are just lying around. This could happen if you’re running docker containers in background or forgot to use --rm flag.

Not to worry, just run this command to remove ALL running docker containers in one go:Continue reading →

Streaming folders from a server over SSH using tar and gzip

This is how you can stream a folder or multiple folders from a server over SSH protocol.

To stream folders in uncompressed, raw format, run:

Since the tar file is being streamed raw, this could potentially take longer as more data is being passed between server and client. In my test for 700 megabytes of data, this command took 1:56 seconds.

There’s another method. Continue reading →

%d bloggers like this: