【问题标题】:How can I get my Win32 app running with Wine in Docker?如何在 Docker 中使用 Wine 运行我的 Win32 应用程序?
【发布时间】:2020-09-01 01:12:44
【问题描述】:

我有一个 Win32 应用程序,它公开一个 REST 端点并显示一个记录请求的窗口。它是用 Delphi 编写的,是 32 位的。

我已经使用 Wine (4.0.4) 在 Ubuntu (20.04) 中运行它。它直接开箱即用。我创建了一个 32 位前缀并启动它。一切都很好。这是一个干净的 Ubuntu VM,只安装了 Wine。

我现在正试图将它放在 Docker 容器中,但我无法让它运行。我正在使用xvfb-run 来支持 UI。

当我尝试在容器中运行应用程序时,我收到以下消息/警告/错误:

0010:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0010:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0010:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0010:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0010:err:ole:get_local_server_stream Failed: 80004002

不过,应用程序确实似乎启动了。当我向端口 9000(应用程序侦听的端口)发出请求时,我看到报告了更多错误(并且没有得到响应——我关闭了套接字)。这些错误是:

0019:err:ole:CoGetClassObject class {88d96a05-f192-11d4-a65f-0040963251e5} not registered
0019:err:ole:create_server class {88d96a05-f192-11d4-a65f-0040963251e5} not registered
0019:err:ole:CoGetClassObject no class object {88d96a05-f192-11d4-a65f-0040963251e5} could be created for context 0x5

我不确定我的容器中缺少什么,因为它在桌面环境中运行良好。

我的 Dockerfile 如下:

FROM ubuntu:20.04

RUN apt-get update

RUN apt-get install -y wget software-properties-common gnupg2 xvfb

RUN dpkg --add-architecture i386
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
RUN apt-get update
RUN apt-get install -y winehq-stable winetricks winbind

RUN apt-get clean -y
RUN apt-get autoremove -y

ENV WINEDEBUG=fixme-all

ENV WINEPREFIX=/root/.catalyst
ENV WINEARCH=win32
RUN xvfb-run winecfg

RUN winetricks msxml6

WORKDIR /root

COPY app catalyst

EXPOSE 9000

CMD ["xvfb-run", "wine", "/root/catalyst/CATALYSTWeb.exe"]

【问题讨论】:

  • 88d96a05-f192-11d4-a65f-0040963251e5 是 MS XML 6 COM 对象
  • 我已经通过 winetricks 添加了 msxml6(请参阅更新的 Dockerfile)。似乎没有帮助。同样的错误。

标签: docker wine


【解决方案1】:

我解决了。 Dockerfile 下面。

我还必须在启动我的应用程序之前添加一个sleep 1s 以允许启动一些服务。

FROM ubuntu:20.04

RUN apt-get update

RUN apt-get install -y wget software-properties-common gnupg2 winbind xvfb

RUN dpkg --add-architecture i386
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
RUN apt-get update
RUN apt-get install -y winehq-stable

RUN apt-get install -y winetricks

RUN apt-get clean -y
RUN apt-get autoremove -y

ENV WINEDEBUG=fixme-all

RUN winetricks msxml6

COPY app /root/catalyst
COPY startup.sh /root/startup.sh
RUN chmod gou+x /root/startup.sh

EXPOSE 9000

CMD ["/root/startup.sh"]

startup.sh

#!/usr/bin/env bash

sleep 1s
xvfb-run wine /root/catalyst/CATALYSTMWeb.exe

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-05
    • 2023-03-31
    • 2019-08-07
    • 2016-03-13
    • 2021-01-12
    • 2017-05-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多