Goodmorning everyone,
I’ve been working on a Docker project that was created by a collegue 2 years ago and has been lying around since. I’ve recently picked this up and continued where he left off. But for some reason I run into a lot of errors trying to run the containers. Most of them I have fixed and could get on to the next error, but now I have one that I can not fix and can’t find a lot about on google.
I’m running into this issue:
container a91b44768359f6780c00c6e32b7e44b0f43222848628a5652546ddcb88a6c56f encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)
The function that is starting the containers:
function Docker-Run {
<#
.SYNOPSIS
Build a part from the amt docker file
.PARAMETER PartName
[String] The part’s name.
.OUTPUTS
#>
param (
[Parameter(Mandatory=$true)][String]$PartName
)
$Part = $null
foreach ($PartTest in $Global:Settings.Docker.Parts.ChildNodes) {
if ($PartTest.ImageName -eq $PartName) {
$Part = $PartTest
break
}
}
if ($null -eq $Part) {
Throw "Docker-Run: Part [$PartName] could not be found in the Docker.xml"
}
$Volume = ""
if ($Part.Volume -ne "") {
$Volume = "-v " + $Part.Volume
}
$PortMapping = ""
if ($Part.PortMapping -ne "") {
$PortMapping = "-p " + $Part.PortMapping
}
$DockerImageName = "$($global:ImageAccount)/$($Part.ImageName)".ToLowerInvariant() #
Write-Host "docker run $DockerImageName"
Invoke-Expression "docker run $PortMapping -i -d --rm --name $($Part.RunName) $DockerImageName"
}
Yes I’m not using the $Volume, this was in the Invoke-Expression but also caused issues. It made the container exit.
Hope anyone can help me further.
Maikel