[英]Visual Studio 2019 does not pull required Docker images at project open
I am under the impression that Visual Studio should pull all the required Docker images at project startup; 我的印象是,Visual Studio应该在项目启动时提取所有必需的Docker映像。 hence, I expect it download and start SQL Server and RabbitMQ images since they are defined in my docker compose:
因此,我希望它下载并启动SQL Server和RabbitMQ映像,因为它们是在我的docker compose中定义的:
version: '3.4'
services:
sql.data:
image: microsoft/mssql-server-linux:2017-latest
rabbitmq:
image: rabbitmq:3-management-alpine
projectname:
image: ${DOCKER_REGISTRY-}projectname
build:
context: .
dockerfile: ProjectName/Dockerfile
depends_on:
- sql.data
- rabbitmq
I see the following in Container Tools
window when visual studio opens my project: 当Visual Studio打开我的项目时,我在“
Container Tools
窗口中看到以下内容:
========== Checking for Container Prerequisites ==========
Verifying that Docker Desktop is installed...
Docker Desktop is installed.
========== Verifying that Docker Desktop is running... ==========
Verifying that Docker Desktop is running...
Docker Desktop is running.
========== Verifying Docker OS ==========
Verifying that Docker Desktop's operating system mode matches the project's target operating system...
Docker Desktop's operating system mode matches the project's target operating system.
========== Pulling Required Images ==========
Checking for missing Docker images...
Docker images are ready.
========== Warming up container(s) for DataCollector ==========
Starting up container(s)...
docker run -dt -v ...
Container started successfully.
========== Finished ==========
When I run docker ps -a
in PowerShell, I see: 当我在PowerShell中运行
docker ps -a
时,我看到:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a24958fbc70f projectname:dev "tail -f /dev/null" 13 minutes ago Up 13 minutes 0.0.0.0:56656->80/tcp, 0.0.0.0:44396->443/tcp intelligent_babbage
So obviously it has not pulled (and started) the RabbitMQ and SQL Server containers. 因此很明显,它没有拉(并启动)RabbitMQ和SQL Server容器。
I checked the settings at Tools > Options > Container Tools
and Pull required Docker images on project open
is set to True
. 我在“
Tools > Options > Container Tools
检查了设置,并Pull required Docker images on project open
设置为True
。
I am puzzled why the containers are not pulled then. 我不解为什么为什么不拉容器。
诀窍是将启动项目更改为DockerCompose
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.