国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【異常解決】(一)解決docker報(bào)錯failed to compute cache key: “...“ not found

這篇具有很好參考價(jià)值的文章主要介紹了【異常解決】(一)解決docker報(bào)錯failed to compute cache key: “...“ not found。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

本文章僅做記錄異常用途

使用.net core右鍵LY.ProductSchedularService.Api自動生成dockerfile
并使用

docker build -t my_service .

構(gòu)建鏡像時,報(bào)錯提示:
failed to compute cache key: “/App/LY/NetCore/LY.Common/LY.Common.csproj” not found: not found

DockerFile如下

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 5677

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["App/LY/NetCore/LY.ProductSchedularService.Api/LY.ProductSchedularService.Api.csproj", "App/LY/NetCore/LY.ProductSchedularService.Api/"]
COPY ["App/LY/NetCore/LY.Entity/LY.Entity.csproj", "App/LY/NetCore/LY.Entity/"]
COPY ["App/LY/NetCore/LY.Common/LY.Common.csproj", "App/LY/NetCore/LY.Common/"]
RUN dotnet restore "App/LY/NetCore/LY.ProductSchedularService.Api/LY.ProductSchedularService.Api.csproj"
COPY . .
WORKDIR "/src/App/LY/NetCore/LY.ProductSchedularService.Api"
RUN dotnet build "LY.ProductSchedularService.Api.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "LY.ProductSchedularService.Api.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "LY.ProductSchedularService.Api.dll"]

原因分析:
Dockerfile不能跟LY.ProductSchedularService.Api項(xiàng)目同級的,因?yàn)樵擁?xiàng)目依賴引用了其他的2個項(xiàng)目,使用這個docker build命令會提示找不到另外的項(xiàng)目
解決方法:
把Dockerfile放于與App文件夾同級的目錄下即可文章來源地址http://www.zghlxwxcb.cn/news/detail-504572.html

到了這里,關(guān)于【異常解決】(一)解決docker報(bào)錯failed to compute cache key: “...“ not found的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包