Forum Discussion
ooker
Sep 03, 2023Copper Contributor
How to write a script to start a Docker container and stop WSL safely when the container stops?
I’m writing a PowerShell script to start a container and stop WSL safely when the container stops. Here is my attempt: $ContainerName = 'tranky'
$DockerDesktopPath = "C:\Program Files\Docker\Docker\...
LainRobertson
Sep 04, 2023Silver Contributor
I don't know anything about Docker, but I can try and help with your first question (though not the second question about logging).
When you say that docker start fails, what does that look like? Is it just that nothing happens, or do you get a detailed error message?
If you put a large delay after the Start-Process (i.e. Start-Sleep -Seconds 20) and before the docker start, does the the docker start work then?
Do you know if the Docker desktop process spawns any child processes you can monitor for?
Knowing some of this may help us help you with the first question.
Cheers,
Lain