How to read Powershell variable inside Dockerfile?
问题 I'm building Docker Desktop for Windows image. I try to pass a variable to a Powershell command, but it does not work. Dockerfile # escape=` FROM microsoft/windowsservercore SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN $someVar="2.60.3" ; echo $someVar Docker build Sending build context to Docker daemon 2.048kB Step 1/3 : FROM microsoft/windowsservercore ---> 2c42a1b4dea8 Step 2/3 : SHELL powershell -Command