Please note that most of these instructions are derived from Microsoft's VS Code documentation: Developing inside a Container. Check the official documentation if you encounter problems and submit a PR with any corrections you find for the instructions below.
The development container included in this repository is derived from Microsoft's default Ubuntu development container. Contents of the Ubuntu Docker image can be in the VS Code devcontainer Ubuntu base Dockerfile. The contents of the container used for development can be found in the Dockerfile located in the same directory as this README.
tauri-apps/tauri
code.Prerequisites are mainly derived from VS Code's instructions for usage of development containers, documented here: Developing inside a Container: Getting Started.
Due to limititations in how Docker shares files between the Docker host and a container, it's also recommended that developers clone Tauri source code into a container volume. This is optional, but highly advised as many filesystem/IO heavy opearations (cargo build
, yarn install
, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
To do this, open your project with VS Code and run Remote-Containers: Clone Repository in Container Volume... from the Command Palette (F1).
Docker Desktop provides facilities for allowing the development container to connect to a service on the Docker host. So long as you have an X window server running on your Docker host, the devcontainer can connect to it and expose your Tauri GUI via an X window.
Export the DISPLAY
variable within the devcontainer terminal you launch your Tauri application from to expose your GUI outside of the devcontainer.
export DISPLAY="host.docker.internal:0"