Add support for volume binds and additional options
This commit is contained in:
parent
64751fb294
commit
13c5ad58ec
@ -36,6 +36,22 @@ if($remote) {
|
|||||||
$image = $imagename
|
$image = $imagename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$response = Read-Host "Do you want to bind the container home directory into a windows directory? [N/y]"
|
||||||
|
|
||||||
|
$additionaloptions = ''
|
||||||
|
if ($response -eq 'y') {
|
||||||
|
$directory = Read-Host "Write the windows directory destination relative to WSL, for example `"/mnt/c/Users/Username/Desktop/ExampleFolder`"`n"
|
||||||
|
mkdir -Force $directory | Out-Null
|
||||||
|
$additionaloptions = "-v ${directory}:/home/designer"
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = Read-Host -Prompt "Do you want to set additional arguments for the container instantiation? [N/y]"
|
||||||
|
|
||||||
|
if ($response -eq 'y') {
|
||||||
|
$response = Read-Host -Prompt "Write the additional arguments, for example -v <wsl_path>:<container_path>."
|
||||||
|
$additionaloptions = -join($additionaloptions, $response)
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
|
|
||||||
$dockercommand = ("docker run -d " +
|
$dockercommand = ("docker run -d " +
|
||||||
@ -45,6 +61,7 @@ $dockercommand = ("docker run -d " +
|
|||||||
"-e WAYLAND_DISPLAY=`$WAYLAND_DISPLAY " +
|
"-e WAYLAND_DISPLAY=`$WAYLAND_DISPLAY " +
|
||||||
"-e DISPLAY=`$DISPLAY " +
|
"-e DISPLAY=`$DISPLAY " +
|
||||||
"-e XDG_RUNTIME_DIR=/mnt/wslg " +
|
"-e XDG_RUNTIME_DIR=/mnt/wslg " +
|
||||||
|
"$additionaloptions "+
|
||||||
$image)
|
$image)
|
||||||
|
|
||||||
wsl -d Ubuntu bash -ic $dockercommand
|
wsl -d Ubuntu bash -ic $dockercommand
|
||||||
|
Loading…
Reference in New Issue
Block a user