ProteoWizard / container

Options for running ProteoWizard applications via containers (e.g. Docker)
Apache License 2.0
9 stars 8 forks source link

wine msconvert --help shows empty output #18

Closed edmondop closed 1 year ago

edmondop commented 1 year ago

In the documentation on DockerHub, it seems that the msconvert --help command is supported.

In particular, a specific section says:

For msconvert command-line help: docker run -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine msconvert --help at https://hub.docker.com/r/proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses

However, when trying locally, this doesn't work

❯ docker run -it proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses:3.0.23052-0c85f26 /bin/sh
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
# wine msconvert --help
# exit
❯ docker run -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine msconvert --help
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
❯ docker run --platform linux/amd64 -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine msconvert --help
chambm commented 1 year ago

That warning message is more of an error. Wine only works on x86 or x86_64 and pwiz is compiled for x86_64, so it actually only works on that.

edmondop commented 1 year ago

So I should expect not to run any message unless I specify platform linux/x86?

That's a little suprising: 

WARNING: image with reference proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses was found but does not match the specified platform: wanted linux/x86, actual: linux/amd64 docker: Error response from daemon: image with reference proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses was found but does not match the specified platform: wanted linux/x86, actual: linux/amd64. See 'docker run --help'.

chambm commented 1 year ago

You want linux/amd64 (amd64=x86_64).

edmondop commented 1 year ago

In the last line here https://github.com/ProteoWizard/container/issues/18#issue-1702755495 I am using amd64, but still getting an empty output. Am I missing something? Thank you for your help

chambm commented 1 year ago

Your detected host platform is arm64. You need to run on a amd64 host. I'm not sure why it doesn't give you a warning or error when you try to run the amd64 image on arm64 though (with the --platform flag).

edmondop commented 1 year ago

The Docker for Mac app comes packed with QEMU out of the box - so Docker is able to run either arm64 and amd64 images. Most official images are now supported on arm64 too. If you're building an image, by default it'll use your native architecture to execute the build (arm64) and most things will magically just work.

chambm commented 1 year ago

I don't have any experience using QEMU to run Wine. A little googling suggested it was easy to have problems with that approach. What if you run something other than msconvert like wine regsvr32. Also try wine64 instead of wine.

edmondop commented 1 year ago

Thanks, regsvr32 works using both wine and wine64

❯ docker run --platform linux/amd64 -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine64 msconvert --help
❯ docker run --platform linux/amd64 -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine64 regsvr32
Wine DLL Registration Utility

Provides DLL registration services.

Usage:
  regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName

Options:
  [/u]  Unregister a server.
  [/s]  Silent mode (no messages will be displayed).
  [/i]  Call DllInstall, passing an optional [cmdline].
        When used with [/u] DllInstall is called in uninstall mode.
  [/n]  Do not call DllRegisterServer. This option must be used with [/i].

❯ docker run --platform linux/amd64 -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine regsvr32
Wine DLL Registration Utility

Provides DLL registration services.

Usage:
  regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName

Options:
  [/u]  Unregister a server.
  [/s]  Silent mode (no messages will be displayed).
  [/i]  Call DllInstall, passing an optional [cmdline].
        When used with [/u] DllInstall is called in uninstall mode.
  [/n]  Do not call DllRegisterServer. This option must be used with [/i].
chambm commented 1 year ago

Try to run this trivial .NET executable in wine: PrintNetFrameworkVersion.zip

You can mount it with -v like -v /path/to/downloads:/downloads and then run it like docker run --platform linux/amd64 -it --rm -v /path/to/downloads:/downloads proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine /downloads/PrintNetFrameworkVersion.exe.

It should print .NETFramework,Version=v4.7.2

edmondop commented 1 year ago
❯ docker run --platform linux/amd64 -it --rm -v `pwd`:/downloads proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine /downloads/PrintNetFrameworkVersion.exe.

Same empty line. I am trying now to run this in GitPod which uses a plain Linux box

You can try to use this https://gitpod.io/#/https://github.com/ProteoWizard/container

also docker run -it --rm proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine msconvert --help there doesn't produce any output

chambm commented 1 year ago

I don't know anything about gitpod.io. When I ran wine regsvr32 on it that didn't produce any output either, but ls / did. Maybe that's a docker in docker or docker in VM issue. But PrintNetFrameworkVersion is a super simple 2 line .NET program, so if it doesn't produce output then there's something wrong with the docker/QEMU/wine/.NET combination. I don't know what that would be. But I've gotten just the docker/wine/.NET combination working in several more traditional contexts: on Windows running Docker Desktop, on a real Linux/AMD64 box running standard docker, and on Linux/AMD64 VMs.

edmondop commented 1 year ago

Can you maybe share the details of the Docker Host Linux/AMD64 you are using?

docker system info
chambm commented 1 year ago

Extremes?

edmondop commented 1 year ago

Sorry, that was a typo

chambm commented 1 year ago

Here's one from AWS Linux 2 that works.

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 5
 Server Version: 20.10.4
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.14.219-164.354.amzn2.x86_64
 Operating System: Amazon Linux 2
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.69GiB
 Name:
 ID: LLIC:MCYI:XFBK:MRNS:OB7I:C277:XQRM:B3T7:5YEK:PRGX:2HTL:HAL7
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false