Why I use tools like Docker and Flatpak
I admit it, I am a big fan of pre-packaged software. Software that I simply set up by typing a single command or just adding a few lines to my existing configuration. I like simplicity and this kind of software makes things a lot easier and lets one focus on getting work done.
I still remember the time when I first came into contact with Linux and spent a lot of time with it. I was curious, tried all kinds of things, installed programs, changed configurations, what you do when you discover how much more possibilities Linux distributions offer you than you were used to from Windows. And of course if you are a curious technophile teenager.
Or when I first rented a virtual private server on which I could run a website with WordPress.
In the end it was often the case that I had played around so much that at some point nothing worked anymore, I had broken my system. I had changed something, uninstalled an important program or changed a configuration that the only thing that helped was to reinstall the system. I probably used some commands that I had seen in long instructions on the Internet, without giving any further thought to them.
What does this have to do with Docker and Flatpak?
When I was experimenting with WordPress and the like, I was never completely satisfied with the installation after I had got it running basically. I wanted to install another program, or update the PHP version of the Linux distribution. Sometimes it worked, but often this was a big effort or it didn’t work and I destroyed my system.
It wasn’t until I took a closer look at Docker and, after some initial confusion, understood the basic concepts and realized that it’s actually not that complicated to use, that I realized what a great opportunity this tool offers.
I was able to install several programs in parallel, although they had completely different requirements for the installation environment, such as programs that require different PHP, Node.js or Python versions. Or I could run the same program multiple times in parallel. Or if I don’t need a program anymore, I could simply uninstall it without leaving a lot of configuration files on the system. Or if needed, I could create my own Docker image with my own changes and just try out if it really works.
And to install a whole combination of programs, I could simply write the configuration into a Docker Compose file and one command was enough to start everything at once.
The same applies to Flatpak on the desktop. Roughly speaking, Flatpak is the Docker for the desktop. Desktop applications in a sandbox, easy to install, update and remove.
Yesterday, when I reinstalled my desktop system and switched to another Linux distribution (because I couldn’t get my Bluetooth keyboard to work), I got to know another advantage of Flatpak. Before the reinstallation I did a backup of my entire
/home directory. So after I reinstalled all the Flatpak applications I had installed before, I could simply restore almost all files and configurations of the Flatpak apps by copying the
.var folder from the backup without having to set up everything from scratch. Flatpak creates a virtual file system in this folder for each application.
If I had installed all programs manually via the package management of the Linux distribution, it would not have been enough to simply copy a folder to restore all configurations. I would have had to copy many different folders. And maybe there would have been further problems if the new Linux distribution does not offer all programs or only older versions. I wouldn’t have been able to do the whole migration in under two hours.
This is now my personal opinion, but I think it would be better if Linux distributions would focus more on a solid base system and leave the packaging of applications to others. Because every Linux distribution tries to include and maintain each application in its own package sources, there is much more duplication of effort. And it leaves some users with outdated program versions.
Tags: Docker Flatpak Linux Software Tools