What I want
I want to set the username and password when I start the container for example:
docker run --password=mysupersafepw --user=myusername mcr.microsoft.com/windows/servercore
What I've got
At the moment the user and password is hardcoded in my dockerfile:
RUN net USER /ADD ssh Passw0rd && net localgroup Administrators ssh /ADD
What I've tried
I already heard about environment variables, but this (in the dockerfile) doesn't work for me:
ENV user=ssh
ENV password=Passw0rd
[...]
RUN net USER /ADD ${user} ${password} && net localgroup Administrators ${user} /ADD
docker build results in:
Step 10/14 : RUN net USER /ADD ${user} ${password} && net localgroup Administrators ${user} /ADD
---> Running in 2552caf74946
The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.
More help is available by typing NET HELPMSG 2245.