I’m having a Dockerfile similar to this
FROM mcr.microsoft.com/windows/servercore:10.0.17763.437
COPY . .
COPY WindowsContainerStartupScript.ps1 C:\\scripts
WORKDIR c:\\assets
ENTRYPOINT powershell ls &&
CMD cmd /c tasklist
when I build that on my dev machine (version 19.03.5), I get the following on docker inspect image
"Cmd": [
"cmd",
"/S",
"/C",
"#(nop) ",
"CMD [\"cmd /S /C cmd /c tasklist\"]"
],
"ArgsEscaped": true,
"WorkingDir": "C:\\assets",
"Entrypoint": [
"cmd /S /C powershell ls &&"
],
when I build the same Dockerfile on another machine (version 18.09.6), I get the following
"Cmd": [
"cmd",
"/S",
"/C",
"cmd /c tasklist"
],
"ArgsEscaped": true,
"WorkingDir": "C:\\assets",
"Entrypoint": [
"cmd",
"/S",
"/C",
"powershell ls &&"
],
Problem with the first one is that on
docker run myImage:myTag cmd /c anyCommand
it will always fail with the message “container 6dc24a8608a164d1570eac47c01355e0e1707098e8818184c1332824705b2687 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified.”
Is this a bug? Should I file it somewhere?
Any suggestions on how to run two commands during container start? I want to run a Powershell script and as soon as it completes launch another process selected by user.