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):
- libgcc is part of GCC’s low-level runtime library that contains helpers for arithmetic operations, error handling and miscellaneous operations.
- libstdc++ is the GNU Standard C++ Library v3.
- bintuils is a collection of “binary tools”
- file is Unix and Unix-like operating systems for recognizing the type of data contained in a computer file.
- gmp is a C arithmetic precision library
- isl is a C “integer set library”
- libgomp is a C multi processing runtime library
- libatomic is a C atomic operations library
- mpfr4 is a C “multiple-precision floating-point computations with correct rounding” library
- mpc1 is a “multi precision” C library
- gcc is the GNU Compiler Collection
- musl-dev is the musl c library implementation with development files.
- libc-dev is a “meta package” for libc
- g++ is the GNU C++ Compiler
- make is the GNU make utility
- fortify-headers is a compile time buffer check library; and finally