问题:编译eshoponcontainers失败,提示error:invalid reference format

Posted sulerzh

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了问题:编译eshoponcontainers失败,提示error:invalid reference format相关的知识,希望对你有一定的参考价值。

环境:

visual studio 2017 v15.4.2,docker ce Version 17.06.0-ce-win19 (12801)

参考问题页:

https://github.com/dotnet-architecture/eShopOnContainers/issues/107

问题:

F5运行是报错:

error : Building webstatus

error : invalid reference format.

与:

audipen commented on 26 Sep edited

的问题一致。

 

原因与解决方案:

audipen commented on 28 Sep edited

So finally figured out the issue. After comparing the docker-compose file with a ‘Hello World‘ application I realised that the ‘image‘ tag in the docker-compose was causing the ‘invalid reference format‘ error.

For example in the definition of the ‘basket‘ microservice the ‘image‘ has the following value.
basket.api:
image: eshop/basket.api:${TAG:-latest}

If I remove ‘:${TAG:-latest}‘ everything runs as expected. Not sure what the problem with the value is though. Still not that docker proficient. I removed this tagging for all service entries. 

sgreenmsft commented on 7 Oct

@audipen The issue with the ${TAG:-latest} was a bug in the VS Docker tools. It‘s fixed in the VS 2017 15.4 update (currently in preview).

 

解决方案:

删除docker-compose.yml中所有镜像的 ‘:${TAG:-latest}‘ 后缀。因为默认debug模式下,visual studio 2017 docker tools会生成docker-compose.vs.debug.g.yaml,会在镜像后增加:dev标签。如果在docker-compose.yaml中增加了latest标签,则会导致生成的镜像为name:latest:dev,导致编排失败。

这是visual studio 2017 docker tool的bug,会在后续版本解决。

当前的解决方案是,删除所有‘:${TAG:-latest}‘ 后缀。

 

以上是关于问题:编译eshoponcontainers失败,提示error:invalid reference format的主要内容,如果未能解决你的问题,请参考以下文章

记录自己运行eShopOnContainers过程中遇到的坑

[eShopOnContainers 学习系列] - 02 - vs 2017 开发环境配置

项目模板eShopOnContainers

[eShopOnContainers 学习系列] - 00 - 开发环境需求

eShopOnContainers 是一个基于微服务的.NET Core示例框架

解析微软微服务架构 eShopOnContainers