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



我正在开发一个应用程序的源代码,并在系统上安装该应用程序的发布版本
如何在不与安装的版本冲突的情况下测试修改后的(可能有缺陷的(应用程序?我想要的基本上是虚拟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之类的命令
  • docker构建包括将整个代码库复制到映像中,以及安装编译所需的所有工具和库,其中一些工具和库没有存储在缓存中,每次都会安装。因此,每次编译和运行脚本都需要几分钟的时间

所以我的问题是:
docker是完成这项任务的最佳解决方案吗?我确信这是许多开源贡献者面临的问题,但我在网上找不到其他案例。如果这不是最好的解决方案,还有什么替代方案?

详细错误:
我运行了命令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

警告最终是原因:我只需要根据这个线程安装gtk2引擎pixbuf

编辑:我误解了成功。我之所以能让它工作,是因为我以前在docker中运行过另一个GUI程序。事实上,我终于发现第二次尝试geany是有效的,尽管第一次尝试会出错。

最新更新