如何在 Docker 中运行 GUI 应用程序?

如何在 Docker 中运行 GUI 应用程序?

我正在尝试在我的 Parrot OS docker 容器中安装 Packet Tracer,如下所示教程和我的Dockerfile现在看起来像这样(只是为了测试):

FROM parrotsec/core
COPY PacketTracer_731_amd64.deb /root/PacketTracer_731_amd64.deb
RUN apt-get install -y /root/PacketTracer_731_amd64.deb

当我运行命令时

docker build -t gparrot .

我收到以下错误:

Sending build context to Docker daemon  181.1MB
Step 1/3 : FROM parrotsec/core
 ---> 167d5a59b3ce
Step 2/3 : COPY PacketTracer_731_amd64.deb /root/PacketTracer_731_amd64.deb
 ---> Using cache
 ---> 1df7860c2821
Step 3/3 : RUN apt-get install -y /root/PacketTracer_731_amd64.deb
 ---> Running in 2bbb80e41fd9

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 packettracer : Depends: sudo but it is not installable
                Depends: dialog but it is not installable
                Depends: xdg-utils but it is not installable
                Depends: gtk-update-icon-cache but it is not installable
                Depends: libgl1-mesa-glx but it is not installable
                Depends: libpulse0 but it is not installable
                Depends: libnss3 but it is not installable
                Depends: libxss1 but it is not installable
                Depends: libasound2 but it is not installable
                Depends: libxslt1.1 but it is not installable
                Depends: libxkbcommon-x11-0 but it is not installable
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get install -y /root/PacketTracer_731_amd64.deb' returned a non-zero code: 100

请告诉我问题是什么以及如何解决?

答案1

基本parrotsec/core映像不提供 X 显示服务器。只需遵循使用 ubuntu 指南 - 使用apt-get.添加入口点并在 Dockerfile 中公开所需的端口

相关内容