Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't run mlgtools container #1

Open
uebmaster opened this issue Mar 3, 2023 · 4 comments
Open

I can't run mlgtools container #1

uebmaster opened this issue Mar 3, 2023 · 4 comments

Comments

@uebmaster
Copy link

Hi.

I've followed the instructions to run mlgtools container but when i execute:

docker run --rm -it -v $PWD:/data -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/metaphorme/mgltools

I got:

setting PYTHONHOME environment
Run ADT from  /opt/mgltools/MGLToolsPckgs/AutoDockTools
Traceback (most recent call last):
  File "/opt/mgltools/MGLToolsPckgs/AutoDockTools/__init__.py", line 417, in runADT
    root = Tk()
  File "/opt/mgltools/lib/python2.7/lib-tk/Tkinter.py", line 1685, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TclError: couldn't connect to display "host.docker.internal:0"
hit enter to continue

I've tried too with the next docker-compose file:

version: '3.3'
services:
    metaphorme:
        ports:
            - '80:80'
        volumes:
            - '/var/run/docker.sock:/tmp/docker.sock:ro'
            - '$PWD:/data'
            - '/tmp/.X11-unix:/tmp/.X11-unix'
        restart: always
        logging:
            options:
                max-size: 1g
        image: ghcr.io/metaphorme/mgltools

But i got:

mlgtools-metaphorme-1  | Run ADT from  /opt/mgltools/MGLToolsPckgs/AutoDockTools
mlgtools-metaphorme-1  |     self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
mlgtools-metaphorme-1  | TclError: couldn't connect to display "host.docker.internal:0"
mlgtools-metaphorme-1  | Traceback (most recent call last):
mlgtools-metaphorme-1  |   File "/opt/mgltools/MGLToolsPckgs/AutoDockTools/bin/runAdt.py", line 16, in <module>
mlgtools-metaphorme-1  |     AutoDockTools.runADT(sys.argv, ownInterpreter=ownInterpreter, AdtScriptPath=__file__)
mlgtools-metaphorme-1  |   File "/opt/mgltools/MGLToolsPckgs/AutoDockTools/__init__.py", line 574, in runADT
mlgtools-metaphorme-1  |     raw_input("hit enter to continue")
mlgtools-metaphorme-1  | EOFError: EOF when reading a line
mlgtools-metaphorme-1 exited with code 1

What am i doing wrong?

Thanks in advance.

@Metaphorme
Copy link
Owner

Conld you please make sure that you run this container on MacOS and have installed XQuartz?
MGLTools container have only test on MacOS. It maybe run well on Windows, but couldn't run on linux without other settings. For more information, please click.

@muammar
Copy link

muammar commented Dec 14, 2023

Same problem for me:

  % docker run --rm -it -v $PWD:/data -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/metaphorme/mgltools                                                                                                                                             !4501
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
setting PYTHONHOME environment
Run ADT from  /opt/mgltools/MGLToolsPckgs/AutoDockTools
Traceback (most recent call last):
  File "/opt/mgltools/MGLToolsPckgs/AutoDockTools/__init__.py", line 417, in runADT
    root = Tk()
  File "/opt/mgltools/lib/python2.7/lib-tk/Tkinter.py", line 1685, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TclError: couldn't connect to display "host.docker.internal:0"
hit enter to continue

I have macOS as well as XQuartz. I "partially" solved this following instructions here: https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285?permalink_comment_id=3477013#gistcomment-3477013

However, after following those, mlgtools container failed with:

  % docker run --rm -it -v $PWD:/data -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/metaphorme/mgltools                                                                                                                                             !4511
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
setting PYTHONHOME environment
Run ADT from  /opt/mgltools/MGLToolsPckgs/AutoDockTools
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Warning: disabling accumulation buffers couldn't choose pixel format
Couldn't configure togl widget
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  704
  Current serial number in output stream:  703

@Metaphorme
Copy link
Owner

@muammar Thanks for your detailed report!

The following error occurred:

X Error of failed request: GLXBadContext
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 704
Current serial number in output stream: 703

I found a similar issue, I think this problem has to do with MacOS as local settings. Maybe you could do as follows to fix it:

  • Make sure you have followed the installation instructions.
  • Make sure you have installed the latest XQuartz(Version: 2.8.5(xorg-server 21.1.6))

Hope these could fix this problem. Have a nice day :)

@NewbieTP-14
Copy link

@muammar I faced the same problem. However, after I added the command blow, it fixed my problem before adding the localhost to xhost.

  • defaults write org.xquartz.X11 enable_iglx -bool true

I hope this can also fix your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants