Robert's Homepage

What Is Alpine Build Base

#linux #docker #software development

Alpine Linux is a popular Linux distribution in the Docker community. Alpine’s primary marketing is a distribution that is a security-oriented, lightweight, simple and based on musc libc and busybox. musc libc is> … an implementation of the C standard library built on top of the Linux system call API, including interfaces defined in the base language standard, POSIX, and widely agreed-upon extensions– musl libc website

and busybox is an embedded centric combination of:

… tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system. BusyBox has been written with size-optimization and limited resources in mind.– busybox website

The end product is a general lightweight Linux distribution that is a great base image option for Docker containers. However, if you’ve come across Alpine before when creating Docker containers you’ve likely come across the package build-base before. A quick Google search will probably reveal this GitHub thread , which presents the build-base package as a convenient equivalent of build-essential in the Ubuntu world. But what’s inside of it? Let’s create a simple Dockerfile and build a container to find out!

By building this container via docker build . I am greeted with the following output (snipped for brevity):

Neat!