[英]How can I get VS2019+ to run docker compose?
I have a solution containing an Azure Function App and my app uses CosmosDb and some other services when debugging/running locally via Visual Studio.我有一个包含 Azure Function 应用程序的解决方案,我的应用程序在通过 Visual Studio 在本地调试/运行时使用 CosmosDb 和一些其他服务。
I have a docker-compose.yml file that lets me spin up the relevant services in docker.我有一个 docker-compose.yml 文件,可以让我在 docker 中启动相关服务。
Currently I have to run docker compose up
manually before starting my application in Visual Studio.目前,在 Visual Studio 中启动我的应用程序之前,我必须手动运行
docker compose up
。
Is there a way to have Visual Studio automatically run docker compose up
when I start start debugging and have it automatically run docker compose down
when debugging ends?有没有办法让 Visual Studio 在我开始调试时自动运行
docker compose up
并在调试结束时自动运行docker compose down
?
Is there a way to have Visual Studio automatically run docker compose up when I start start debugging and have it automatically run docker compose down when debugging ends?
有没有办法让 Visual Studio 在我开始调试时自动运行 docker compose up 并在调试结束时自动运行 docker compose down?
To run the docker compose up
once done with docker compose build
it takes a long time to complete the operation even if our container gets created, Then try to cancel by using ctrl+c
and run again with the below given command in your terminal of visual studio docker compose up -d
.要在完成
docker compose build
后运行docker compose up
,即使我们的容器已创建,也需要很长时间才能完成操作,然后尝试使用ctrl+c
取消并在可视化终端中使用以下给定命令再次运行工作室docker compose up -d
。
To use docker compose down
it needs to choose the type to delete the images as shown below once mentioned it will delete based on your requirement.要使用
docker compose down
需要选择删除图片的类型,如下所示一旦提到它会根据您的要求删除。
RUNNING COMMAND SCREENSHOT FOR REFERENCE:-运行命令屏幕截图以供参考:-
For more information please refer the below links:-有关更多信息,请参阅以下链接:-
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.