Docker has a rich library of base images, and we strongly recommend that you select a lean image that fits your application well. However, you may choose to custom-build your base image from the get go. Here, in this recipe, we will use debootstrap to create our Ubuntu 18.04 LTS (Xenial Xerus) base image. The debootstrap utility can create any Debian-based system by downloading it from the appropriate repository.
Creating a custom base image
Getting ready
Install debootstrap on any Debian-based system using the following command:
$ apt-get install debootstrap