Artur Mukhamadiev f4e1e1a4f4 init
2025-10-07 20:35:19 +03:00

29 lines
676 B
PowerShell

param(
[string]$ContainerName = "gui-app-container",
[switch]$Build
)
if ($Build) {
Write-Host "Building Docker image: $ContainerName" -ForegroundColor Green
docker build -t $ContainerName .
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed!" -ForegroundColor Red
exit 1
}
}
$dockerCommand = @(
"run", "-it", "--rm",
"--name", $ContainerName,
"-v", "/tmp/.X11-unix:/tmp/.X11-unix",
"-v", "/run/desktop/mnt/wslg:/mnt/wslg",
"-e", "DISPLAY=$DISPLAY",
"-e", "WAYLAND_DISPLAY=wayland-0",
"-e", "XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir"
)
$dockerCommand += $ContainerName + " bash"
docker @dockerCommand