Windows Docker Image - encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified

Hi, I am newbie in docker, trying to build a Windows image. Below is my Dockerfile instructions.

I have Docker installed in Windows 10 Pro 10.0.18363. Docker desktop version is 2.3.0.2 (45183) and Engine is 19.03.8.

I am trying to build to dockerize this Web Tours app.

Perl is a prerequisite to run Web Tours.

I got the Perl docker file instructions from this GitHub.

But when I run below docker file, it is failing while running Expand Archive step with container 5c224882e205058fab95c130547bb2f98cb428019b8587df2e89508e4223920c encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. error.

Could you please let me know how to fix this issue? Thanks!

RUN Expand-Archive -Path c:\WebTours.zip -DestinationPath c:\WebTours -Force
# escape=`

FROM mcr.microsoft.com/windows/servercore:ltsc2019

ENV PERL_VERSION 5.26.1.1

ENV PERL_SHA256 1bb54d7f5e487ff468bf980dbfd9962fb9d83ff1f10ccde008e0bee1f1f5b6ce

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Invoke-WebRequest $('http://strawberryperl.com/download/{0}/strawberry-perl-{0}-64bit-portable.zip' -f $env:PERL_VERSION) -OutFile 'perl.zip' -UseBasicParsing ; `

    if ((Get-FileHash perl.zip -Algorithm sha256).Hash -ne $env:PERL_SHA256) { Write-Error 'SHA256 mismatch' } ; `

    Expand-Archive -Path perl.zip -DestinationPath C:\ -Force ; `

    rm perl.zip ; `

    setx /M PATH $('C:\c\bin;C:\perl\bin' -f $env:PATH)

COPY WebTours.zip c:\

RUN Expand-Archive -Path c:\WebTours.zip -DestinationPath c:\WebTours -Force

I was able to fix the issue by adding {0} to the setx command. Thanks!

I am facing the same issue. Can you write the whole setx command here. Was it
setx /M PATH $(‘C:\c\bin;C:\perl\bin’ -f $env:PATH){0} ?