In a Windows docker container I'm trying to set an environment variable based on a build argument.
I have tried this:
docker build --build-arg MYVAR="test" .
In the Dockerfile I have:
#escape=`
ARG MYVAR
ENV MYENVVAR {`"endpointCredentials`": [{`"password`": `"$Env:MYVAR`"}]}
But when I run Get-Item $Env:MYVAR I get:
{"endpointCredentials": [{"password":":MYVAR"}]}
What I want is
{"endpointCredentials": [{"password":"test"}]}