I have used following commands in the Dockerfile but nothing is working, I am using powershell console for container.
please suggest
RUN powershell -Command "New-Item -ItemType Directory -Force -Path 'C:\Program Files\Java'"
RUN powershell -Command "New-Item -ItemType Directory -Force -LiteralPath 'C:\Program Files\Java'"
RUN powershell -Command "if (!(Test-Path 'C:\Program Files\Java')) { New-Item -ItemType Directory -Force -Path 'C:\Program Files\Java' }"
RUN powershell -Command "& { New-Item -ItemType Directory -Force -Path 'C:\Program Files\Java' }"
RUN powershell -Command "New-Item -ItemType Directory -Force -Path \"C:\Program Files\Java\""
I did not get you what does it mean where is the rest? FROM?
Did you read the tutorial ? I would not expect a Dockerfile without FROM to work.
FROM mcr.microsoft.com/windows/servercore:ltsc2019
I am unable to find any reliable reference in the above doc that explains how to create a folder inside a Windows container. ( I am referring powershell in Dockerfile )
and at below highlighted place I want to add powershell command to add a folder
shy123789
(Shy123789)
July 8, 2025, 10:50am
7
I could resolve this myself , you can ignore
system
(system)
Closed
August 7, 2025, 10:50am
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.