简体   繁体   English

如何让 VS2019+ 运行 docker compose?

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

相关问题 如何连接到在 docker-compose 中运行并使用 ec2 实例部署的数据库? - How can I connect to database running in docker-compose and deployed with ec2 instance? 如何在谷歌云运行上运行 docker-compose? - How to run docker-compose on google cloud run? 如何使用 CI/CD 为 Gitlab 注册表推送基于 docker 组合的图像 - How can I push docker compose based images for Gitlab Registry Using CI/CD 我可以将 AWS Copilot 与 docker-compose.yml 文件一起使用吗? - Can I use AWS Copilot with docker-compose.yml file? 如何从 docker-compose 文件在 CDK 中创建 Docker 图像资源? - How do I create Docker image assets in CDK from a docker-compose file? 将 docker-compose 部署到 Cloud Run 或 GCP? - Deploying docker-compose to Cloud Run OR GCP? 尝试运行 docker-compose up -d 时出现错误 - I got error when try to run docker-compose up -d 如何在 Google Cloud Run (docker-compose) 上使用 Celery + Reddis 部署 Django 应用程序 - How to deploy Django Application with Celery + Reddis on Google Cloud Run (docker-compose) 我需要在 docker compose as volume 中设置 aws config 吗? - Do I need to set aws config in docker compose as volume? 如何让 Jenkins 在不同的端口上运行? - How can I get Jenkins to run on a different port?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM