netcore web running docker

docker ps -a # View run
dcoker images # view mirror, similar to a virtual machine
docker container # represents the mirror running processes can use the command docker ps to see running Container
Docker STOP Stop # xxx Container
Docker RM xxx # delete Container
Docker rmi xxx # delete the image, need to remove the container has been launched to delete image.

docker build -t aspnetcoredocker. # build a image in the current directory.
docker run --name = aspnetcoredocker -p 8090: 80 -d container name aspnetcoredocker # --name operating instructions
-p 7777 represents the specified port for external access port
7777: Internal 80 indicates the actual port
-d parameter represents a daemon process name .

After the release of Visual Studio to create a new file system in a directory published without the suffix Dockerfile file, as follows

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime # depend on the environment
WORKDIR / App
COPY.. .. # indicates that the current directory
EXPOSE 80 # indicates the container to open ports 80, 80 here does not really open port and running in the container 80 may be mapped to a port on the container port.
ENTRYPOINT [ "dotnet", "aspnetapp.dll "] #web entrance dll project

 Reference: https://www.cnblogs.com/stulzq/p/9201830.html

 

Guess you like

Origin www.cnblogs.com/ms_senda/p/12154479.html