有没有办法将应用程序安装与系统隔离?

问题描述

我正在处理应用程序的源,并在系统上安装了该应用程序的发行版。
如何在不与已安装版本冲突的情况下测试已修改(可能有错误)的应用程序? 我想要的基本上是virtual env,但适用于一般应用程序。
我尝试了Docker,但这有几个问题:

  • 我无法使X11重定向正常工作。我根据一些论坛话题尝试了docker run -ti --net=host -e disPLAY=:0.0 test-docker-geanydocker run -ti -e disPLAY=$disPLAY -v /tmp/.X11-unix:/tmp/.X11-unix test-docker-geany之类的命令。
  • 泊坞窗构建涉及将整个代码库复制到映像,以及安装编译所需的所有工具和库,其中一些工具和库未存储在缓存中并每次都安装。因此,每次您要编译和运行该脚本时,都需要花费几分钟。

所以我的问题是:
泊坞窗是此类任务的最佳解决方案吗?我确信这是很多开源贡献者都面临的问题,但我在网上找不到其他情况。 如果不是最佳解决方案,还有哪些替代方案?

详细错误
我运行了xhost +命令,并在第一个问题中给出了第一个命令,我得到了:

The program 'geany' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 173 error_code 2 request_code 130 minor_code 3)
  (Note to programmers: normally,X errors are reported asynchronously;
   that is,you will receive the error a while after causing it.
   To debug your program,run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Dockerfile:https://pastebin.com/p03vaWbU

解决方法

警告最终是原因:我只需要根据this thread安装gtk2-engines-pixbuf

编辑:我误解了成功。我之所以能够工作是因为之前我在docker中运行了另一个GUI程序。实际上,我终于发现,尽管第一次尝试会给出错误,但再次尝试geany还是可以的。