title: How to run an asp dot net core image in Linux?
body: <p>I am using this docker file to build it </p>
  
  <pre><code>FROM microsoft/dotnet:2.1-sdk-alpine3.7 AS build
  WORKDIR /app
  COPY Packt.HelloWorld.csproj ./
  RUN dotnet restore
  
  COPY . ./
  RUN dotnet publish -c Release -o /published
  RUN ls -alrth /published
  
  FROM microsoft/dotnet:2.1-runtime-deps-alpine3.7 AS base
  WORKDIR /app
  COPY --from=build /published .
  RUN ls -alrth /app
  
  # ENTRYPOINT ["dotnet", "TestApp.dll"] &lt;-- I can run in Windows like this
  ENTRYPOINT ["Packt.HelloWorld"]
  </code></pre>
  
  <p>The debug <code>ls</code> can show all files under the <code>/app</code> folder 
  But if I use this </p>
  
  <p><code>ENTRYPOINT ["/app/Packt.HelloWorld"]</code></p>
  
  <p>It complained there is no such a path. </p>
  
  <pre><code>docker: Error response from daemon: OCI runtime create failed: 
  container_linux.go:348: starting container process ca                                                             
  used "exec: \"/app/Packt.HelloWorld\": stat /app/Packt.HelloWorld: no such file or directory": unknown.
  </code></pre>
  
  <p>if I use </p>
  
  <pre><code>ENTRYPOINT ["Packt.HelloWorld"]
  </code></pre>
  
  <p>It gave me </p>
  
  <pre><code>docker: Error response from daemon: OCI runtime create failed: 
  container_linux.go:348: starting container process caused "exec: 
  \"Packt.HelloWorld\": executable file not found in $PATH": unknown.
  </code></pre>
  
  <p>The image seems to build properly and content are also in there, it's just the running not successful. </p>
  
  <p>Can anyone give me a hint what I am missing? </p>
  
  <p>Thanks </p>