2023-09-06 04:11:20 +00:00
|
|
|
param([switch] $remote = $false)
|
2023-09-06 04:04:33 +00:00
|
|
|
|
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:45:53 +00:00
|
|
|
if($remote) {
|
2023-09-06 04:04:33 +00:00
|
|
|
$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
|