This project demonstrates equivalent package installation and usage across different Linux distributions using Docker. It includes Dockerfiles for multiple distributions that install the same core utilities and a test framework to verify their functionality.
Each Docker image includes these essential tools:
bash- Bourne Again Shellcurl- Command line tool for transferring datajq- Command-line JSON processorgit- Version control systempython3- Python programming language interpretermake- Build automation toolzip/unzip- Archive compression tools
Additional utilities with distribution-specific names:
| Functionality | Ubuntu | Alpine | Fedora | openSUSE |
|---|---|---|---|---|
| Text Search | silversearcher-ag | the_silver_searcher | the_silver_searcher | the_silver_searcher |
| Which Command | debianutils | which | which | coreutils |
| Network Tools | net-tools | iproute2 | iproute | iproute2 |
| Process Utils | psmisc | procps | procps-ng | procps |
- Ubuntu 22.04
- Alpine 3.19
- Fedora 39
- openSUSE Leap 15.5
- Docker
- GNU Make
- Bash shell
Build all distribution images:
make buildBuild a specific distribution image:
make image-ubuntu # For Ubuntu
make image-alpine # For Alpine
make image-fedora # For Fedora
make image-opensuse # For openSUSEThe test suite verifies that all installed packages are working correctly by:
- Using
curlto download JSON data from GitHub's API - Using
gitto create a repository and commit the file - Using
jqto process and extract information from the JSON - Using
python3to read and process the JSON file - Creating and running a simple
Makefile
Run tests for all distributions:
make testTest a specific distribution:
make test-ubuntu # For Ubuntu
make test-alpine # For Alpine
make test-fedora # For Fedora
make test-opensuse # For openSUSE.
├── README.md
├── Makefile # Build and test automation
├── Dockerfile.ubuntu # Ubuntu image definition
├── Dockerfile.alpine # Alpine image definition
├── Dockerfile.fedora # Fedora image definition
└── Dockerfile.opensuse # openSUSE image definition
- Automatic discovery of Dockerfiles
- Parallel build support
- Consistent naming conventions
- Automated testing
- Distribution-agnostic test suite
To add support for a new distribution:
- Create a new
Dockerfile.[distro]file - Install the required packages using the distribution's package manager
- The Makefile will automatically detect and include the new distribution
The new distribution will automatically be included in build and test targets.