title: Pass ENV var through 'docker run -e MY_VAR=value' to entrypoint.sh?
body: <p>I am trying to pass ENV vars at runtime to my docker container's startup file (<code>entrypoint.sh</code>) through the dockerfile.  The ENV vars come from a key vault in an azure devops pipeline.</p>
  
  <p>I can't seem to pass in ENV vars with a simple <code>docker run -e YUMMY_USER=$(MY_USER) -e YUMMY_PASSWORD=$(MY_PW) yummyAppImage</code>.  The vars are used to login to an authorization service.  It should be noted that both the user and password coming from the key vault contain special characters.  My dockerfile looks like this:</p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
  MAINTAINER YummyLumpkins &lt;yummy@lumpkins.com&gt;
  
  WORKDIR /app
  
  COPY . ./
  RUN dotnet restore
  
  RUN dotnet publish YummyApp -c Release -o out
  
  FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
  WORKDIR /app
  COPY --from=build-env /app/out .
  
  COPY entrypoint.sh ./
  RUN dos2unix entrypoint.sh &amp;&amp; chmod +x entrypoint.sh
  CMD ["/app/entrypoint.sh"]
  </code></pre>
  
  <p>And my shell script file looks like so:</p>
  
  <pre><code>#!/bin/sh
  set -e
  
  az login --service-principal --username $YUMMY_USER --password $YUMMY_PASSWORD
  dotnet /app/YummyApp.dll
  
  exec "$@"
  </code></pre>
  
  <p>I have tried to manually pass in the ENV vars in the <code>docker run</code> command, like so:
  <code>docker run -e YUMMY_USER=exampleuser12983#$23 -e YUMMY_PASSWORD=examplepw(*&amp;876 YummyAppImage</code> but the login service simply doesn't see the arguments.</p>
  
  <p>Perhaps my syntax is incorrect? Any help would be greatly appreciated.  Thanks!</p>