简体   繁体   English

将 gRPCserver 项目从 Visual Studio 发布到 Docker Hub 存储库

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

I build a gRPC server into Visual studio.我在 Visual Studio 中构建了一个 gRPC 服务器。 This server I debugged by deploying it into a local Docker container.我通过将它部署到本地 Docker 容器中来调试此服务器。 This is working great.这很好用。 For this, I am using following Dockerfile:为此,我使用以下 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"]

Pushing the Docker image in my local repository, which I used for debugging purposes, to a remote repository for deployment doesn't really work.将我用于调试目的的本地存储库中的 Docker 映像推送到远程存储库以进行部署实际上并不起作用。 (I already figured that out). (我已经想通了)。

As I am searching still a way to deploy, I tried following link (where I deploy to Docker Hub): https://docs.microsoft.com/en-us/visualstudio/containers/deploy-docker-hub?view=vs-2019当我仍在寻找一种部署方式时,我尝试了以下链接(我部署到 Docker 集线器): https://docs.microsoft.com/en-us/visualstudio/containers/deploy-docker-hub?view=vs -2019

Trying to deploy to Docker hub, makes the compiler stop with the next error:尝试部署到 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 ==========

I am trying to do pretty default stuff.我正在尝试做一些非常默认的东西。 Cannot believe this is going wrong.无法相信这是错误的。 Anybody ideas or experience on this matter?有人对此事有想法或经验吗? Pretty desperate to fall back on manual Docker build.非常渴望依靠手动 Docker 构建。

My VPN wasn't configured correctly.我的 VPN 配置不正确。 I solved this problem closing the VPN temporary.我解决了这个临时关闭 VPN 的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将visual.net 2015中的asp.net 5发布到linux - Publish asp.net 5 from visual studio 2015 to linux 将 ASP.NET Core 从 Visual Studio 发布到 Linux - Publish ASP.NET Core from Visual Studio to Linux Visual Studio 的“Docker 调试”无法安装 linux 包,但是发布/发布解决并安装了包 - Visual Studio's "Docker Debug" fails to install linux package, however release/publish resolves and installs the package 在 Visual Studio 的 Linux docker 容器中调试 nunit 测试 - Debug nunit tests in a Linux docker container from Visual Studio 从Visual Studio 2012项目创建“ .o”文件 - Creating a “.o” file from a Visual Studio 2012 project 从Linux交叉编译到Windows Visual Studio项目 - Cross compile from linux to windows a visual studio project 从多个 docker hub 镜像或私有 repo docker 构建镜像 - Building image from multiple docker hub images or private repo docker 我们是否应该一开始就从Docker Hub安装Docker映像? - Should we install a docker image from Docker Hub at the begining? 如何在 Haskell 和 Docker 中使用 Visual Studio Code - How to use Visual Studio Code with Haskell and Docker 在 ubuntu 上克隆 git 集线器存储库 - cloning git hub repository on ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM