-
-
Notifications
You must be signed in to change notification settings - Fork 1
Installation with Docker
Using Docker is the recommended method for running moleditpy.
GUI applications like moleditpy depend on many complex system libraries for graphics, windowing, and keyboard input. Using Docker creates a self-contained environment with all these dependencies included, allowing you to run the application easily and reliably without altering your host system.
Before you begin, please ensure the following software is installed on your system:
-
Git: Required to clone the repository.
-
Docker: Please install Docker for your operating system.
-
X11 Server (Required for GUI Display): An X11 server is necessary to display the application's GUI from within the container on your desktop.
- Linux: Typically included by default in most desktop Linux distributions. No additional installation is required.
- macOS: Install and run [XQuartz](https://www.xquartz.org/).
- Windows: Install and run an X11 server like [VcXsrv](https://sourceforge.net/projects/vcxsrv/). (This may not be necessary if you are using WSL2 with WSLg support.)
First, clone this repository to your local machine.
git clone https://github.com/HiroYokoyama/python_molecular_editor_docker.git
cd python_molecular_editor_dockerIn the root directory of the repository (where the Dockerfile is located), run the following command to build the Docker image.
docker build -t moleditpy-app .- The
-t moleditpy-appflag tags the image with the namemoleditpy-app. - The final
.specifies that Docker should use theDockerfilein the current directory. - The initial build may take several minutes.
Follow the instructions for your operating system to launch the container and run moleditpy.
-
(One-time setup) Open a terminal on your host machine and allow connections from local containers:
xhost +local:docker
-
Launch the container:
docker run --rm -it \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ moleditpy-app
-
Launch XQuartz. In XQuartz's settings, ensure "Allow connections from network clients" is checked in the "Security" tab.
-
Open a terminal on your host machine and allow connections:
xhost + 127.0.0.1
-
Launch the container:
docker run --rm -it \ -e DISPLAY=host.docker.internal:0 \ moleditpy-app
-
Launch VcXsrv. When launching, it is recommended to check the "Disable access control" box.
-
Find your host machine's IP address. Open Command Prompt or PowerShell and run
ipconfigto find the IPv4 address of your active network adapter. -
Launch the container. Replace
<your-ip-address>with the IP address you found in the previous step.docker run --rm -it \ -e DISPLAY=<your-ip-address>:0.0 \ moleditpy-app
-
If you get an
Error: cannot open displaymessage:- Ensure your X11 Server (XQuartz, VcXsrv) is running.
- Verify that the
xhostcommand was executed correctly. - Double-check that the
DISPLAYenvironment variable is set correctly for your environment.
-
If you get a
Cannot connect to the Docker daemonmessage:- Make sure the Docker Desktop application or the Docker service is running.