问题描述
我刚刚用最新的.Net Core Preview SDK创建了一个Web应用程序.我试图在Linux Docker上运行它,但是该项目无法构建.
我收到的错误是:
I have just created a web application with the latest .Net Core Preview sdks.I am trying to run it on Linux Docker however the project does not build.
The error I am receiving is:
错误未设置DOCKER_REGISTRY变量.
默认为空字符串.使用默认驱动程序创建网络"dockercompose11433628216532645154_default"
构建testapppreview2
服务'testapppreview2'生成失败:找不到microsoft/aspnetcore:2.1的清单.
Error The DOCKER_REGISTRY variable is not set.
Defaulting to a blank string.Creating network "dockercompose11433628216532645154_default" with the default driver
Building testapppreview2
Service 'testapppreview2' failed to build: manifest for microsoft/aspnetcore:2.1 not found.
我的docker-compose.yml文件
My docker-compose.yml file
version: '3.4'
services:
testapppreview2:
image: ${DOCKER_REGISTRY}testapppreview2
build:
context: .
dockerfile: TestAppPreview2/Dockerfile
它的替代项是:
version: '3.4'
services:
testapppreview2:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "80"
有人可以指引我一些方向吗?
Can someone direct me some direction please?
其他信息:
错误将我指向此文件:
C:\ Program Files(x86)\ Microsoft Visual Studio \ Preview \ Community \ MSBuild \ Sdks \ Microsoft.Docker.Sdk \ build \ Microsoft.VisualStudio.Docker.Compose.targets 363
Further information:
The error points me to this file:
C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets 363
推荐答案
出现此错误时,您应该看一下Output -> Docker
,通常它可以说明问题所在.您尝试覆盖的容器可能正在运行.或其他一些配置问题.
When you get this error you should take a look at Output -> Docker
, usually it shows what is the problem. It could be that container you are trying to overwrite is running. Or some other configuration problem.
通过阅读Docker Output,您应该能够快速推断出问题所在并加以解决.太糟糕了,Visual Studio并没有指示您执行此操作,但是现在仅给出此一般性The DOCKER_REGISTRY variable is not set
错误.
By reading Docker Output you should be able to quickly deduce what is the problem and fix it. Too bad that Visual Studio doesn't instruct you to do this, but for now only give this generic The DOCKER_REGISTRY variable is not set
error.
这篇关于无法在Docker上运行Dot Net Core预览项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!