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.

docker 镜像创建

 

相关文章:

  • 2021-12-30
  • 2021-12-08
  • 2021-11-28
  • 2021-07-17
  • 2021-05-19
猜你喜欢
  • 2021-06-24
  • 2021-10-28
  • 2021-09-19
  • 2021-08-07
  • 2021-11-06
相关资源
相似解决方案