简体   繁体   English

如何查看在Docker容器上运行的c#应用程序中的更改?

[英]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.

相关问题 对在Docker容器上运行的C#点网络应用程序进行性能分析 - Profiling a C# dot net application running on a docker container 容器内容如何在C#Windows应用程序中呈现? - How can Container content be rendered in a C# Windows Application? 如何从在 Linux(docker 容器)上运行的 c#.net 核心在远程 Windows 网络路径上运行 .exe - How to run .exe on remote windows network path from c# .net core running on Linux (docker container) 我如何在C#中以Al窗口形式查看组合 - How can i see a combo in al window forms in c# 在 C#,如何查看我的数据集是否为空? - In C#, How can i see if my dataset is empty? 我如何接管我的 C# 程序面板中的另一个正在运行的应用程序? - How can I take over, another running application within a panel of my C# program? 通过BAT文件运行应用程序时,如何更新C#类中的参数? - How can I update a parameter within a C# Class when running the application via a BAT file? 如何在WinForm C#中获取当前正在运行的应用程序名称和ID? - How can i get Current running Application name and ID in WinForm C#? 在 C# DLL 文件中作为进程运行时,如何获取控制台应用程序输出? - How can I obtain console application output when running it as a process in a C# DLL file? 如何使用 docker 中托管的 c# 应用程序调用 bash 脚本,这将对主机进行更改 - How to call bash script using c# application hosted in docker and that will make changes to the host machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM