Creating base image from scratch

Hello Dockers,

I was wondering if there is any way to create a base image from scratch ? What I mean is I have a CentOSX machine working, practically I have CentOS 6 on which I have configured Nagios to be operational. It works out-of-box with minimal configuration changes. This Nagios is also monitoring the three remote servers in the network. I understand that there exist CentOS images on hub but I want to do this exercise for deeper understand of how the image is manufactured in first place. Maybe there would be a business case for any company to write their own from scratch…

What I want to do is
a. For fun create a base image form my current VM which is configured with application and tool set I want.
b. I want nagios application be made running in “container” fashion and do exactly the same thing as it is doing now, not sure if that is possible?

Would appreciate input.

Thanks
Jim

You have two options:

  • use FROM scratch in Dockerfile (scratch is a “special” image which contains nothing)
  • bundle the root filesystem into a tar archive (I think you may need to add some Docker-specific metadata as well) and use docker load