docker / dev-environments

63 stars 32 forks source link

Option to start dev environments created from git source inside a WSL context #143

Open Mario1159 opened 1 year ago

Mario1159 commented 1 year ago

Tell us about your request

Context Starting containers inside a WSL distribution is useful for running X/Wayland graphical applications with the WSL graphics stack (wslg). When starting dev environments using Docker Desktop from a git source, containers are started from a normal windows path outside WSL (Users/user/.docker/devenvironments/), this means the container wont have access to the WSLg system distribution, thus the environment variables and paths binded to enable graphics wont exist or make sense.

Request Having an option to start the container in the default WSL distribution when creating the dev environment by git source or have some kind of integration with the WSLg container binds.

Motivation This would facilitate windows developers using dev enviroments that also provide tool stacks with graphical applications.


Are you currently working around the issue?

Graphical applications can be executed in Windows from a docker-compose.yml/compose-dev.yaml file that resides in a WSL distribution with the 'Local directory' option. A docker compose environment example that enable graphics in Windows:

services:
  devenv:
    image: ubuntu:latest
    command: sleep infinity
    tty: true
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - /mnt/wslg:/mnt/wslg
    environment:
      - DISPLAY=$DISPLAY
      - WAYLAND_DISPLAY=$WAYLAND_DISPLAY
      - XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR
      - PULSE_SERVER=$PULSE_SERVER