Posts with the tag initramfs:

Using docker image as your desktop system

In recent years, docker has created a containerization boom around the world by providing a way to easily create and run application containers. Containers save people from dependency hell by packaging the software with the operating environment it needs. Although docker was designed to be neither an operating system container nor an operating system running directly on the bare metal, docker’s powerful suite of tools will also give us tremendous convenience in managing our desktop system running on bare metal.

Why using docker image as a desktop system is a good idea? Let’s begin with talking about the inconvenience of the normal way how people are managing their desktop systems. Nowadays, most of us has more than one computer, and we want these computers to be “consistent”. Here when I say “consistent”, I mean, for example, I begin writing a document on one computer (say, at home) and am unable to finish it before having to switch to another computer (say, at work). I don’t want to worry about copying it manually to another computer, instead, I want it to be able to magically appear there so I can access it at any time. This is exactly what cloud sync disks like Dropbox do for us. However, for geeks, what cloud sync disks do is far from enough. For example, you are busy with a project, which uses a number of programming languages, libraries, and a bunch of GUI and non-GUI tools. As you keep trying new things, you install new tools and change configurations continually on your system. It would be nice if these changes can be synced across different devices automatically so that when you install something you won’t need to install it one by one on each of your computers.




为什么要用Docker镜像当作桌面系统?这就要从普通桌面系统的不方便之处说起。通常我们都拥有不止一台电脑,我们希望这些电脑能够保持一致。这里所说的“一致”,用一个例子来讲,就是我在一台电脑上编辑了一半的文件,不需要认为拷贝到另一台电脑上,而是直接打开电脑就能编辑。如果这个文件只是一个纯文本文件,或者一个Microsoft Word文档,那么实现这个一致性非常简单:把文件扔到Dropbox之类的云同步盘就好。然而对于专业用户来讲,这种一致性的保持并非单纯的扔到Dropbox里面那么简单:比如说你最近忙于一个项目,这个项目要用到若干编程语言,然后在电脑里装了一堆库,一堆工具软件,有图形界面的,也有命令行的。在工作的过程中,你有可能不断安装新的工具,或者决定弃用某个之前计划使用的库或者工具。要让你的工作在你的若干台电脑上都能工作,就要一直维护不同机器的环境的一致性:在一台机器上安装的工具,要在所有机器上重新安装一遍。在一台机器上升级了的库,要在所有机器上都升级,稍微有所差池,就有可能出现某个脚本/程序在一台机器上跑的好好的,在另一台机器上却无法运行的问题。