Recently I created a docker container from a centos base image which ran a jboss. Originally I had installed the jdk (and committed) which made the container bulky (about 85
I think you will find this issue easily resolvable if you are using Dockerfiles to build your images, rather than the commit method. If you are using Dockerfiles, you can simply remove the RUN command that added the JDK, and rebuild. This will get rid of the previous layers.
Answering my own question. It seems that docker keeps adding layer to the base image whenever one commits to the image. However little you make your container committing it to the base is going only to add a new layer over the existing image which is always going to inflate the image. The problem with this approach is when you make modifications and commit to the base image, you end up taking unwanted layers to the production. I can see no official way to merge the layers. But there seems to be some workarounds in this link. However, I just recreated everything from the base and committed only once which made the image size very close to the container size.