Mastering Docker Enterprise
上QQ阅读APP看书,第一时间看更新

Picking a PoC application

Picking the right application for a Docker PoC can be challenging. First of all, keep in mind that the overall timeline for containerizing the application should be about three days. This timebox constraint is really important in order to keep the POC moving along. Secondly, there are a couple of fundamental competing criteria that need to be balanced while deciding which application to use for your PoC. 

The first criterion is to pick an application that can be easily containerized with minimal code changes and no refactoring. Because refactoring efforts can cascade into major projects and you only have a few days to complete the containerization process, the idea of minimal code changes should make sense. The second criterion is to pick an application that will be interesting to the stakeholders because it is representative of other applications that would be beneficial to containerize. For example, if you have a bunch of old .NET applications that are difficult to support (this usually becomes an issue as Microsoft sunsets support for a long-time platform such as Windows Server 2008) and you are able to successfully containerize one of these applications as a part of your POC, it will be easy for stakeholders to imagine containerizing the balance of the old .NET applications to significantly reduce support cost. The problem is these applications might be a little more challenging to containerize without code changes.

As we dive in a little deeper, I recommend an article from success.docker.com titled Docker Reference Architecture: Modernizing Traditional .NET Framework Applications. I also recommend another https://success.docker.com/ article authored by Lee Namba and titled Docker Reference Architecture: Design Considerations and Best Practices to Modernize Traditional Apps (MTA)I will use both Bart's and Lee's articles as supporting material as I answer the following question: which applications are the best candidates for containerization (or modernization, as the case may be)? 

To give the best answer, we examine the two most common application platforms separately: Windows applications and Linux applications, starting with the Windows platform. Most commonly, custom .NET applications and Windows console applications make the best targets for containerization. WCF and Windows Services can usually be containerized with a few tweaks, while most commercial applications tend to be very challenging to containerize. Finally, Windows Desktop applications cannot be containerized, at least for now.

Picking a candidate Linux application for your PoC also favors a custom in-house developed application. These are typically three-tier Java applications with an Apache or NGINX web server frontend; a Tomcat, JBoss, WebLogic, or Websphere app server middle-tier, where the Java app is deployed in a single JAR or WAR file, and a relational DB backend. You can't have JNI bindings and you should avoid app server TLS termination. TLS can be terminated either at an upstream load balancer or at the web server frontend/reverse proxy. Also, look for any other dependent service that might make the application hard to isolate, such as messaging and remote DB connections. 

Once you've identified a shortlist of three or four application candidates, take a quick look for suitable base images using google.com to search for something similar to tomcat inurl:hub.docker.com or asp.net 2.2 inurl:hub.docker.com. This might knock out some of your candidates. Hopefully, you'll find a reasonable base image that should work.

Be careful here! Try to avoid the search for the perfect PoC. First, because there is a real chance you will change your mind after you start to containerize the application. Secondly, because you need to timebox the application selection process to one or two days. So, keep in mind it is very possible you will start/restart the containerization process several times. This is one of those fail/learn fast situations. So, it is handy to have a queue of candidate applications to peel through if necessary. 

So to conclude the application selection process, you should have a list of three or four candidate applications shared with the PoC team as the starting point. Before we get started containerizing, we need to get our workstation set up.