This guide provides instructions for building and running the PictoPy frontend using Docker.
- Prerequisites
- Building the Docker Image
- Running the Container
- Accessing the GUI App
- Common Troubleshooting
- Notes on Cross-Platform Compatibility
- Docker installed on your system
- For Windows: An X Server (e.g., VcXsrv or Xming)
- For Linux : An X server also installed
sudo apt install x
-
Open a terminal and navigate to your project's root directory.
-
Go to Frontend directory
cd frontend
-
Run the following command to build the Docker image, replacing
<image_name>
with your desired image name:docker build --build-arg TAURI_SIGNING_PRIVATE_KEY=<private_key> --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD=<password> -t <image_name> .
Replace <private_key> and with your actual Tauri signing private key and password and <image_name> with the image name. If you are using the default key, you can use the following command:
docker build --build-arg TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD=pass -t <image_name> .
-
Allow X11 forwarding:
xhost +local:docker
-
Run the container:
docker run -it -p 1420:1420 -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix <image_name>
-
Run the tauri application
npm run tauri dev
-
Start an X Server:
- Launch VcXsrv or Xming.
- Configure it to allow connections from any host.
-
Find your host machine's IP address:
- Open Command Prompt and run
ipconfig
. - Look for the IPv4 Address under your active network adapter.
- Open Command Prompt and run
-
Run the container:
docker run -it -p 1420:1420 -e DISPLAY=<HOST_IP>:0.0 <image-name>
Replace <HOST_IP>
with your actual IP address.
- Run the tauri application
npm run tauri dev
If everything is configured correctly, the Tauri GUI app should display on your screen after running the container.
-
Windows:
- Ensure the X server (VcXsrv or Xming) is running.
- Check that it's configured to allow connections from any host.
-
Linux:
- Verify X11 forwarding is allowed:
xhost +local:docker
- Verify X11 forwarding is allowed:
If the container can't connect to the X server:
- Check your firewall settings and ensure it's not blocking the connection.
- On Windows, try using the host's IP address instead of localhost.
By following this guide and keeping these notes in mind, you should be able to successfully set up and run the PictoPy frontend using Docker across different platforms. If you encounter any persistent issues, please refer to the project's issue tracker or seek assistance from the development team.