簡體   English   中英

將 gRPCserver 項目從 Visual Studio 發布到 Docker Hub 存儲庫

[英]Publish a gRPCserver project from Visual studio into Docker Hub repository

我在 Visual Studio 中構建了一個 gRPC 服務器。 我通過將它部署到本地 Docker 容器中來調試此服務器。 這很好用。 為此,我使用以下 Dockerfile:

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

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
#EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY ["GrpcServer/GrpcServer.csproj", "GrpcServer/"]
RUN dotnet restore "GrpcServer/GrpcServer.csproj"
COPY . .
WORKDIR "/src/GrpcServer"
RUN dotnet build "GrpcServer.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "GrpcServer.csproj" -c Release -o /app/publish

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

將我用於調試目的的本地存儲庫中的 Docker 映像推送到遠程存儲庫以進行部署實際上並不起作用。 (我已經想通了)。

當我仍在尋找一種部署方式時,我嘗試了以下鏈接(我部署到 Docker 集線器): https://docs.microsoft.com/en-us/visualstudio/containers/deploy-docker-hub?view=vs -2019

嘗試部署到 Docker 集線器,使編譯器停止並出現下一個錯誤:

#12 34.06 /src/GrpcServer/GrpcServer.csproj : error NU3037: Package 'System.Diagnostics.DiagnosticSource 4.5.1' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired.
#12 34.06 /src/GrpcServer/GrpcServer.csproj : error NU3028: Package 'System.Diagnostics.DiagnosticSource 4.5.1' from source 'https://api.nuget.org/v3/index.json': The repository countersignature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
#12 34.07 /src/GrpcServer/GrpcServer.csproj : error NU3028: Package 'Microsoft.Extensions.Http 3.0.3' from source 'https://api.nuget.org/v3/index.json': The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
#12 34.07 /src/GrpcServer/GrpcServer.csproj : error NU3037: Package 'Microsoft.Extensions.Http 3.0.3' from source 'https://api.nuget.org/v3/index.json': The author primary signature validity period has expired.
#12 34.08 /src/GrpcServer/GrpcServer.csproj : error NU3028: Package 'Microsoft.Extensions.Http 3.0.3' from source 'https://api.nuget.org/v3/index.json': The repository countersignature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
#12 34.18   Failed to restore /src/GrpcServer/GrpcServer.csproj (in 32.65 sec).
#12 ERROR: executor failed running [/bin/sh -c dotnet restore "GrpcServer/GrpcServer.csproj"]: exit code: 1
------
 > [build 4/7] RUN dotnet restore "GrpcServer/GrpcServer.csproj":
------
executor failed running [/bin/sh -c dotnet restore "GrpcServer/GrpcServer.csproj"]: exit code: 1
2>Build failed. Check the Output window for more details.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

我正在嘗試做一些非常默認的東西。 無法相信這是錯誤的。 有人對此事有想法或經驗嗎? 非常渴望依靠手動 Docker 構建。

我的 VPN 配置不正確。 我解決了這個臨時關閉 VPN 的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM