dockerfile

FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-/} .
ENTRYPOINT ["dotnet", "docker3.dll"]

创建镜像

PS G:\NetDemo\docker3\docker3> docker build bin\Release\netcoreapp2.0\publish -t cystest

查看image

PS G:\NetDemo\docker3\docker3> docker images
REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
cystest                latest              d729b4e79d40        54 seconds ago      527MB
microsoft/aspnetcore   2.0                 1c47c6da0e58        4 days ago          524MB

运行image

PS G:\NetDemo\docker3\docker3> docker run -it -p 5000:80 cystest
Hosting environment: Production
Content root path: C:\app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.

 

posted on 2018-07-16 15:44  chester·chen  阅读(197)  评论(0编辑  收藏  举报