I have the situation where I need to compare packages, settings, configurations across multiple Linux distributions. Docker is a great tool to pull images from all of the linux distributions to compare and contrast nearly anything you can think of. In this post we’ll create a simple docker compose file and run containers from the centos, alpine, ubuntu, archlinux, busybox and debian images.
The docker-compose.yaml file
First we’ll need to install docker-ce and docker-compose. Then create a simple docker-compose.yaml with the following content:
Run the Docker Containers from each Linux Distribution
To run all of our services in the docker-compose.yaml simply put them up.
Run commands for each distribution
Now that we have many different operating systems up let’s run some commands so we can compare. We can take a simple example and look at how the networking interfaces are set up. Note in some of the containers we need to run commands to update the respositories. E.g. docker-compose exec ubuntu apt update and docker-compose exec ubuntu apt install iproute2.
Example to compare IP Interface settings
Example to compare Kernel versions
I was surprised to see them all the same!
To clean up simply do a docker-compose down to stop containers and removes containers, networks, volumes, and images.
Where to go from here?
We have so many different linux distibutions running we can execute commands in each one and easily see the differences. I hope this was useful, let me know in the comments.