I have a Dockerfile that uses a Windows Nano Server base image and uses Powershell as shell:
FROM microsoft/nanoserver
SHELL ["powershell"]
I now want to define a variable (or pass it in via --build-arg
) using the ARG
command and then use it in a RUN
command, but I can't seem to get it to work. I've tried:
ARG mydir=tmp
RUN mkdir %mydir%
RUN mkdir $mydir
But none of these work.
How do I tell docker / powershell to expand my variable correctly?