Add remote option

This commit is contained in:
Mario Romero 2023-09-06 01:04:33 -03:00
parent ce06807f84
commit 0433b2acea

View File

@ -1,14 +1,22 @@
param($remote)
$imagename = Read-Host -Prompt 'Container image to initialize'
$containername = Read-Host -Prompt 'Container instance name [default=$imagename]'
if (!$containername) { $containername = $imagename }
if($remote -eq "remote") {
$image = "git.1159.cl/mario1159/$imagename"
} else {
$image = $imagename
}
$command = ("docker run -d " +
"--name "+ $containername + " " +
"--name $containername " +
"-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 " +
$imagename)
$image)
wsl bash -ic $command