- install docker
- Get the core image
-
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/
- 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"]
- make a mirror
docker build -f -t mytest .
- run image
docker run --name mytest -p 80:8888 --env ASPNETCORE_URLS=http://*:8888 mytest
- browser test
Run .netcore program in docker
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325052423&siteId=291194637
Ranking