osic-stacks/scripts/wsl_start.ps1

22 lines
609 B
PowerShell
Raw Normal View History

2023-09-06 04:04:33 +00:00
param($remote)
2023-09-03 22:53:58 +00:00
$imagename = Read-Host -Prompt 'Container image to initialize'
$containername = Read-Host -Prompt 'Container instance name [default=$imagename]'
if (!$containername) { $containername = $imagename }
2023-09-06 04:04:33 +00:00
if($remote -eq "remote") {
$image = "git.1159.cl/mario1159/$imagename"
} else {
$image = $imagename
}
2023-09-03 22:53:58 +00:00
$command = ("docker run -d " +
2023-09-06 04:04:33 +00:00
"--name $containername " +
2023-09-03 22:53:58 +00:00
"-v /tmp/.X11-unix:/tmp/.X11-unix " +
"-v /mnt/wslg:/mnt/wsl " +
"-e WAYLAND_DISPLAY=`$WAYLAND_DISPLAY " +
"-e DISPLAY=`$DISPLAY " +
"-e XDG_RUNTIME_DIR=/mnt/wslg " +
2023-09-06 04:04:33 +00:00
$image)
2023-09-03 22:53:58 +00:00
wsl bash -ic $command