Dockerise Micronaut application.

Micronauts is a java framework to develop a cloud-native microservices application easily and seamlessly. If you don’t know about Micronaut Please go through below two articles. 

In this article, we are exploring a micronaut framework and How to dockerize it. 

Let us create a small micronaut REST service application and try to dockerize it.

Micronaut provides a CLI option to create an application easily.

$ mn create-app helloworld

This will scaffold a new Gradle project. If you prefer Maven, add a --build maven parameter. If you want to create a new Groovy or Kotlin project, add a --lang parameter.

$ mn create-app --lang groovy helloworld-groovy
$ mn create-app --lang kotlin helloworld-kotlin

These options depend on you, which language are you comfortable with.

These options depend on you, which language are you comfortable with. 

Once the project is ready we can import that in your favorite editor. I am using IntelliJ.

We are using already created Hello world app, source code is available at below location you can clone

By default, micronaut app can create Docker file for you and docker file you can locate on current directory of your project <appname>/Docker 

e.g helloworld/Docker

The Default content of Docker file:

FROM adoptopenjdk/openjdk13-openj9:jdk-13.0.2_8_openj9-0.18.0-alpine-slim
COPY build/libs/helloworld-*-all.jar helloworld.jar
CMD ["java", "", "-Xmx128m", "-XX:+IdleTuningGcOnIdle", "-Xtune:virtualized", "-jar", "helloworld.jar"]

If you are familiar with docker then fine if not you can explore below article to understand docker.

Micronaut create docker file with alpine-slim 

and JDK image which is used here is unofficial.

This repo provides Unofficial AdoptOpenJDK Docker Images,


Thrid line to copy the generated jar(helloworld.jar) file and the expose default port as 8080. Last line to launch the jar file.

For this example, I am using Gradle as a build tool

$ cd helloworld
$ ./gradlew run

To test whether code is working fine or not. (curl http://localhost:8080/hello)

Now build a Docker image from the docker file for that fire below command. 

To run the application with IntelliJ IDEA, you need to enable annotation processing:

  1. open Settings → Build → Execution → Deployment → Compiler →Annotation Processors
  2. Set the checkbox Enable annotation processing

As we know micronaut CLI generates a Dockerfile by default, making it easy to package your application for a container environment such as Kubernetes.

$ docker build . -t hello-world-ex

Fire above command to create a docker image. -t 1.0.0 indicates the tag for this image. Now our image is ready to make a container from its fire below command. 

$ docker run --rm -p 8080:8080 hello-world-ex

As we have exposed 8080 port in docker file. We are doing port mapping to an external system.

to verify the docker image fire below command.

$ curl http://localhost:8080/hello

In this article, we have seen dockerizing micronaut apps. We have created helloworld application and created a docker image using the existing Docker file. You can edit the docker file and optimize it as per your requirement. 

Kubernetes 5 Free Learning resources.

If you don’t know docker read here.

Kubernetes(k8) is an orchestration platform to manage containers.

Kubernetes is the buzzword in the market because of the boom of containerization and microservices. We can have a microservices architecture with its pros and cons and plenty of containers but the question is how to manage those containers and the source of truth is K8.

Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.

It was originally designed by Google, and is now maintained by the Cloud Native Computing Foundation. It aims to provide a “platform for automating deployment, scaling, and operations of application containers across clusters of hosts”.

The definition is from the k8 official website. 

In this article, we will list down 5 free resources to which will help you to learn k8.

Kubernetes is a container orchestration software

  1. Learn K8 basics:- Learn Kubernetes Basics is the official documentation by the developers of Kubernetes. This tutorial will help you to understand the basics step by step guide of k8 cluster orchestration system. Each module contains some background information on major Kubernetes features and concepts and includes an interactive online tutorial. I think this the source of truth to start learning k8.
  2. Learning Path kubernetes:- This course can give us from Kubernetes basics to advanced networking and workloads. This tutorial series introduced by IBM and its very good resource to deep dive into k8. If you’re new to Kubernetes and container orchestration and want to begin learning about it, this learning path covers everything from basic prerequisites to more advanced skills needed for containerization. This course will give you brief the idea about a container up to advance k8 concepts. After completion of this course, you will be able to understand the basics of containers, build containerized applications and deploy them onto Kubernetes, understand the advantages of a deployment that uses Helm with Kubernetes, deploy various microservices with Kubernetes, understand basic networking for applications that are running in Kubernetes and much more.
  3. A Tutorial Introduction to Kubernetes:- A Tutorial Introduction to Kubernetes is provided by Ulaş Türkmen on his blog. In this tutorial series, you will learn how to use Kubernetes using Minikube, how to configure kubectl, understanding nodes and namespaces, how to use the dashboard, deploying various container images in order to demonstrate Kubernetes feature, running service, etc.
  4. Coursera K8:- Architecting with Google Kubernetes Engine Specialisation this is the course name. Actually, this course is design and developed by Google. In this k8 course you will learn, how to implement solutions using Google Kubernetes Engine, or GKE, including building, scheduling, load balancing, and monitoring workloads, as well as providing for the discovery of services, managing role-based access control and security, and providing persistent storage to these applications.
  5. Fundamentals of Containers, Kubernetes, and Red Hat OpenShift:- This course will provide you with an introduction to container and container orchestration technology using Docker, Kubernetes, and Red Hat OpenShift Container Platform. You will learn how to containerize applications and services, test them using Docker, and deploy them on a Kubernetes cluster using Red Hat OpenShift. Additionally, you will build and deploy an application from source code using the Source-to-Image facility of Red Hat OpenShift. After the completion of this course, you will be able to create containerized services, manage containers and container images, create custom container images and deploy containerized applications on Red Hat OpenShift.

Kubernetes — Explained Like You’re Five

Summary:- Modern applications are increasingly built using containers, microservices packaged with their dependencies and configurations. K8s is open-source orchestration software for deploying and managing those containers at scale. With K8s, you can build, deploy, deliver and scale containerized apps faster and smoother.

This is just a list of the sources from where we can start our journey and makes hands dirty. There is a more complete list of concepts available on the Kubernetes website. I suggest you give them a quick look if you want to get a better grasp of who does what and what goes where.

This is it, for now, please let me know if you know more resources which are very simple and effective.

Demystify Docker container technology!!

Demystify Docker container technology!!

For more stories.

Docker is containerization platform.

Nowadays, docker is a buzzword in the industry and docker has taken a major role in the application development workflow. There are many articles but this is not about what is docker? This article is more about behind the screen!! Why this is because last month I was working on AWS, for this purpose I have created one image (RHEL Linux distro). I have faced some issue so when I discuss with my colleague, He said your Image is not tunned. This is where I started exploring what is underneath for docker and come up with this conclusion.

Docker is more optimized and specifically tunned Linux kernel image.

Why Docker?

This image will give you a more clear picture than words. Why docker. Docker is more popular because of quick startup time. Docker is starting instantly and it will save time and efforts. How docker startup instantly? Let us understand this is below

Let us first understand the virtualization method.

  • Emulation
  • Hardware-Assisted Virtualization (Intel Virtualization Technology)
  • Paravirtualization(Xen Hypervisor)
  • FreeBSD Jails
  • Container-based virtualization

Virtualization is categorized based on how it mimics the hardware to guest OS(operating system).

Emulation:- If you are familiar with the emulator such as an android emulator or iOS emulator over your OS. Emulation is full virtualization runs the virtual machine OS kernel entirely in software. In below diagram hypervisor is the full virtualization. This is installed entirely on top of the host OS. The responsibility of this layer to convert for translating guest kernel code to host os instructions. This hypervisor is aka Type-2 hypervisor. The cons of this type are additional system resource overhead that leads to a decrease in performance compared to others. e.g QEMU, VirtualBox, VMware.

Hardware-Assisted Virtualization:- This is aks Intel Virtualization Technology. The idea is to trap execution calls and send them to the virtualization system as the goal is to have most calls run natively and only trap/VMM a small subset of calls.

Paravirtualization:- This is aka Type-1 hypervisor this runs directly on hardware or bare metal and provides the virtualization. The Xen hypervisor is like an operating system of operating systems. It helps the OS, the virtualized hardware, and the real hardware to collaborate to achieve optimal performance. These hypervisors typically have a rather small footprint and do not themselves, require extensive resources. e.g KVM.

FreeBSD Jails:- Ideally free BSD jails are very similar to the lxc container. This is called as other operating system level virtualization. FreeBSD Jails were first introduced in 2000, long way before LXC containers (introduced in 2008) or Docker (introduced in 2013) was released. FreeBSD jails are very similar to docker but its only be used on freeBSD. This is the disadvantage over docker.

Container-based virtualization:- This is aka operating system level virtualization. These runtimes are the platform-dependent parts of the containerization technology as opposed to the platform independent parts that deal with handling the images, etc. The OS level virtualization enables multiple isolated process executions within a single operating system kernel.

e.g LXC, libcontainer.

Container and docker is not a new technology this is the one distro of Linux kernel with limited resource

Let us see some Linux tech stack used in docker.

ulimit a command that lets you set a per-process limit on things like the number of open files.

chroot change the root filesystem. This is a very ancient feature inherited from BSD. This is like jailed inside the directory as its root file system unknown to the entire world.

cggroups process group resource limit. In 2008 Google engineers contributed an important feature to the Linux kernel. A process could be constrained to use their allocated resources. Linux distributions expose cgroups in their filesystem under /sys/fs/cgroup

namespaces This is really the most important contributor to container technology. The namespace will allow you to launch a different network stack for a certain process on.

Union file systemUnionfs is a filesystem service for Linux, FreeBSD & NetBSD which implements a union mount for other file systems. It allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system.

seccompProtecting the system calls Process level. This is the one-way docker providing security. This is how a process allowed to make which system call.

AppArmor and SELinuxMandatory access control system. This is protecting system calls at a system level.

Container runtimeThe two main container runtime is runc and rkt. runs used by docker.

When you are putting everything together within one bucket then the docker container will get the form.

This is what I know and I hope this will be helpful to you.

For more stories

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.

Amazon Corretto!! Another JDK

Amazon Corretto!! Another JDK

For more stories.

No-cost, multiplatform, production-ready distribution of OpenJDK.

Amazon Corretto, a No-Cost Distribution of OpenJDK. From title and Subtitle, you got an idea that this is the openJDK distribution from Amazon.

It’s really great news for Java developers. Amazon has released blog post with below title that makes sense for each one why not this distribution.

Amazon Corretto, a No-Cost Distribution of OpenJDK with Long-Term Support.

“Amazon has a long and deep history with Java. I’m thrilled to see the work of our internal mission-critical Java team being made available to the rest of the world” — James Gosling

Amazon corretto is a no cost, multiplatform, production-ready open JDK distribution. It comes with long-term support including performance enhancements and security fixes. Amazon using corretto internally using in production on thousands of services. This means it is fully tested.

Just FYI Corretto is an Italian word, in English meaning is ” Correct “.

Corretto is certified as compatible with the Java SE standard and is used internally at Amazon for many production services. With Corretto, you can develop and run Java applications on operating systems such as Amazon Linux 2, Windows, and macOS. In response to AWS Linux’s long-term support for Java, AWS recently released the free OpenJDK Amazon Corretto to ensure that cloud users can get stable support. Secure the operation of Java workloads. To ensure compatibility, Arun Gupta, AWS’s chief open source technologist, said that every time Amazon Corretto is released, the development team will implement the TCK (Technology Compatibility Kit) to ensure that the component is compatible with the Java SE platform.

@arungupta said that the workload of Amazon’s internal formal environment also relies heavily on Amazon Corretto’s JDK to meet high performance and large-scale demand. Amazon Corretto can support multiple heterogeneous environments, including the cloud, local data centers, and user development environments. In addition, to expand the scope of application of developers, the platform supported by Amazon Corretto at this stage includes Amazon Linux 2, Windows, macOS and Docker image files. The official version of Amazon Corretto is expected to be released in the first quarter of 2019, and will be compatible with Ubuntu and Red Hat Enterprise Linux.

The JDK is now available for free download by open users, and AWS also promises that Amazon Corretto version 8 free security updates will be available at least until June 2023, while Amazon Corretto version 11 free updates will continue until 2024. August.

This is just a developer preview release if you are a developer go ahead and make your hands dirty with this one.


  1. Backed by Amazon.
  2. Production ready
  3. Multiplatform Support: Linux, Windows, Osx & Docker container too.
  4. No Cost.

You can find the source code for Corretto at

Official Documentation and download preview link

How to install on mac os:

Mac operating system version 10.10 or later. You must have administrator privileges to install and uninstall Amazon Corretto 8.

  1. Download amazon-corretto-jdk-8u192-macosx-x64.pkg.
  2. Double-click the downloaded file to start the installation wizard. Follow the steps in the wizard.
  3. Once the wizard completes, the Corretto 8 Preview will be installed in /Library/Java/JavaVirtualMachines/.

To get the complete installation path, run the following command in a terminal

/usr/libexec/java_home — verbose

4. Set the JAVA_HOME variable.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home

And enjoy the coding.

For Docker:

Build a docker image with Amazon corretto 8.

docker build -t amazon-corretto-jdk-8

Your docker image is ready and a name is amazon-corretto-jdk-8. Run it using below command

docker run -it amazon-corretto-jdk-8

If you want to develop java application and want to use amazon corretto as a parent Image then follow below script.

let us create Hello world java app with amazon corretto.

  1. Create a Dockerfile with the following content.

FROM amazon-corretto-8 RUN

echo $’ \

public class Hello { \

public static void main(String[] args) { \

System.out.println(“Welcome to Amazon Corretto 8!”);

\ }

\ }’ >

RUN javac

CMD [“java”, “Hello”]

2. Build the image.

docker build -t hello-app .

3. Run the image

docker run hello-app

4. Output

Welcome to Amazon Corretto 8!

If you enjoyed this article, please don’t forget to Clap.

For more stories.

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.