[英]How can I see changes in c# application running on Docker container?
I have ASP.NET MVC application in .NET Core. 我在.NET Core中有ASP.NET MVC应用程序。 I run it in Docker using docker-compose.yml and command: 我使用docker-compose.yml和命令在Docker中运行它:
docker-compose up –d
Now I can display my website on http://localhost:5000 . 现在,我可以在http:// localhost:5000上显示我的网站。 But if I change something in class or cshtml file I don't see those changes on http://localhost:5000 . 但是,如果我在类或cshtml文件中进行了更改,则不会在http:// localhost:5000上看到这些更改。 What should I do? 我该怎么办? Stop container and what next? 停止容器,下一步呢? Or something else? 或者是其他东西?
You should rebuild your container 您应该重建容器
docker-compose up –d --build
You can rebuild specific containers in docker-compose like this 您可以像这样在docker-compose中重建特定的容器
docker-compose up –d --build service_name_1 service_name_2
from this source https://docs.docker.com/compose/reference/build/ 从此来源https://docs.docker.com/compose/reference/build/
docker-compose build
Estimated reading time: 1 minute
Usage: build [options] [--build-arg key=val...] [SERVICE...]
Options:
--compress Compress the build context using gzip.
--force-rm Always remove intermediate containers.
--no-cache Do not use cache when building the image.
--pull Always attempt to pull a newer version of the image.
-m, --memory MEM Sets memory limit for the build container.
--build-arg key=val Set build-time variables for services.
--parallel Build images in parallel.
Services are built once and then tagged, by default as project_service. For example, composetest_db. If the Compose file specifies an image name, the image is tagged with that name, substituting any variables beforehand. See variable substitution.
If you change a service’s Dockerfile or the contents of its build directory, run docker-compose build to rebuild it.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.