title: How to set the entrypoint dll dynamically in Docker image
body: <p>We want to use a single <code>Dockerfile</code> for a few different projects.</p>
  <p>The projects structure is the same and the only different as far as the Dockerfile concerns is the entrypoint <code>dll</code>.</p>
  <p>Here is how one of those <code>Dockerfile</code>s looks like:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine3.13-amd64
  
  WORKDIR /app
  COPY . .
  
  ENTRYPOINT [&quot;dotnet&quot;, &quot;dllName.dll&quot;]
  </code></pre>
  <p>I thought about something like that:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine3.13-amd64
  
  ARG DLL_NAME
  
  RUN echo &quot;Building for $DLL_NAME&quot;
  
  WORKDIR /app
  COPY . .
  
  ENTRYPOINT [&quot;dotnet&quot;, $DLL_NAME]
  </code></pre>
  <p>And build it with: <code>--build-arg &quot;DLL_NAME=dllName.dll&quot;</code><br />
  However, the <code>ENTRYPOINT [&quot;dotnet&quot;, $DLL_NAME]</code> command doesn't seem to go through when running the image:</p>
  <pre><code>/bin/sh: [dotnet,: not found
  </code></pre>