Spread the love


Building .DEB package is still a daunting process. It involves a series of compiling, linking and building the source packages. Compiling tuns your source code into object code.Linking combines your object code with libraries into a raw executable whereas building is the sequence composed of compiling and linking, with possibly other tasks such as installer creation.

You start with setting up build process, linking the object code with libraries and then series of steps to build .DEB packages. It involves complexity and series of debugging to reach the end point of creating .DEB packages. Last week I started looking at making the developer’s work more easy. Why not use Docker?  Let me share how easy is it get .DEB packages built up. Here we go:

I picked up nagios as I have a pretty good understanding on Nagios tool.

My Dockerfile looked very similar to the below:


File: build.sh

The file build.sh helps you to build the container through Docker file. Hope this is placed under the parent nagios/ directory.


Once .deb is created through Dockerfile successfully, you might be interested to copy it to the host machine and henceafter removing the container. This file might help you with this.

File: extractdeb.sh


File: resource/configure.sh

The configure.sh provides all the necessary option for supplying the required parameter for nagios to pick and stay on the filesystem as shown below:


That’s it. Just run the below commands in sequence and you are ready to build .DEB package in a single shot:

#cd ajeetraina/nagios



Hope you enjoyed the post. Do reach out to me if you have further ideas and suggestions.

Spread the love
Categories: Docker

Ajeet Raina

My name is Ajeet Singh Raina and I am an author of this blogging site. I am a Docker Captain, ARM Innovator & Docker Bangalore Community Leader. I bagged 2 special awards last year(2019): Firstly, “The Tip of Captain’s Hat Award” at Dockercon 2019, San Francisco, and secondly, “2019 Docker Community Award“. I run Collabnix Community Slack with over 5300+ audience . I have built popular GITHUB repositories like DockerLabs, KubeLabs, Kubetools, RedisPlanet Terraform etc. with the support of Collabnix Community. Currently working as Developer Relations Manager at Redis Labs where I help customers and community members adopt Redis. With over 12,000+ followers over LinkedIn & close to 5100+ twitter followers, I like sharing Docker and Kubernetes related content . You can follow me on Twitter(@ajeetsraina) & GitHub(@ajeetraina)


Leave a Reply

Your email address will not be published. Required fields are marked *