1. 程式人生 > >問題:編譯eshoponcontainers失敗,提示error:invalid reference format

問題:編譯eshoponcontainers失敗,提示error:invalid reference format

otn problem finall init def contain issues timeline ati

環境:

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