Docker 32-bit JRE with WebSphere Liberty

Why bother with 32-bit? Well if you are a small business trying to save cost, WebSphere Liberty Profile allows you to use it within your organization so long as you do not exceed 2GB organization wide. Using an embedded developer’s mentality of being frugal with memory one of the techniques they have is to stick with 32-bit when possible.

From Should I use a 32- or a 64-bit JVM?:

30-50% of more heap is required on 64-bit. Why so? Mainly because of the memory layout in 64-bit architecture. First of all – object headers are 12 bytes on 64-bit JVM. Secondly, object references can be either 4 bytes or 8 bytes, depending on JVM flags and the size of the heap. This definitely adds some overhead compared to the 8 bytes on headers on 32-bit and 4 bytes on references. You can also dig into one of our earlier posts for more information about calculating the memory consumption of an object.

So let’s build a docker image with WebSphere Liberty on a 32-bit platform. Unfortunately, IBM does not provide an official docker image for 32-bit Java much less 32-bit WLP. So I wrote one up…