Run .netcore program in docker

    1. install docker
    2. Get the core image
    3. docker pull microsoft/dotnet

      First, find the official core image at https://hub.docker.com, and the relevant parameter settings are described in detail at https://hub.docker.com/r/microsoft/dotnet/

    4. Make Dockerfile
      cd [ core program release directory ]
      sudo touch Dockerfile
      sudo vim Dockerfile

      Dockerfile file content:

      FROM microsoft/dotnet
        
      COPY . /publish
      
      WORKDIR /publish
      
      EXPOSE 8888
      
      CMD ["dotnet", "WebApp.dll"]
    5. make a mirror
      docker build -f -t mytest .
    6. run image
      docker run --name mytest -p 80:8888 --env ASPNETCORE_URLS=http://*:8888 mytest
    7. browser test
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325052423&siteId=291194637