I am trying to build docker image through Azure DevOps Pipeline (Agent: Windows-latest), here is the Dockerfile.
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
WORKDIR C:/app
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"&& SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -Y
RUN choco install temurin17jre -Y
RUN refreshenv
ENTRYPOINT ["Cmd"]
The pipeline is failing with below error, not sure what went wrong can someone please help me,
Step 7/21 : RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"&& SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -Y
---> Running in e6831658776c
'powershell' is not recognized as an internal or external command,
operable program or batch file.
The command 'cmd /S /C powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New- Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"&& SET
"PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -Y' returned a non-zero code: 1
##[error]The process 'C:\Windows\system32\docker.exe' failed with exit code 1