Building a docker image using simple jar File.

Hi Guys Today is a very Special tutorial of how to create a docker image from scratch.

 

A Simple way to create docker image.

The workflow of Dockerfile and building is very simple. It goes like this….

  1. Docker first run’s the container that you mentioned us FROM (in our case its Java 8). So docker first pulls down that image ,and run’s it.
  2. It then looks for the first instruction after that, and after executing that, it does something similar to #docker commit, so that it saves a layer with what is done till that instruction.
  3. Docker run’s a new container with the last committed image (ie. The image created from the previous instruction step in the Dockerfile. The Running in   type of messages during the build command showed in the above example indicates this.)
  4. It then executes the next instruction in the Dockerfile, and again does a commit and creates another image. So that the very next instruction is executed inside this new image committed. And this process continues till the very last instruction in the Dockerfile.

Feel free to comment for any doubts.

If you like please share and subscribe 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s