Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running docker build - sample grpc application #6223

Closed
mukthiarahamad opened this issue May 4, 2021 · 2 comments
Closed

Error while running docker build - sample grpc application #6223

mukthiarahamad opened this issue May 4, 2021 · 2 comments

Comments

@mukthiarahamad
Copy link

I have created a sample Grpc project with docker support and I am trying to create run the build command but the build command fails with below error.

docker build -t final . --progress=plain
#1 [internal] load build definition from Dockerfile
#1 sha256:b8ff9a930a5fd9cd27fd5e8814f79a8985978b84b4683d8b399aac266d1b29f6
#1 transferring dockerfile: 988B 0.0s done
#1 DONE 0.1s

#2 [internal] load .dockerignore
#2 sha256:e2b52ee6d28f145e15b48efcdefaafbfd433fc825162ca81fc0ff93900052a5b
#2 transferring context: 2B 0.0s done
#2 DONE 0.1s

#3 [internal] load metadata for mcr.microsoft.com/dotnet/sdk:3.1
#3 sha256:ce64eac29b07ebbf4d973b99e492aaf8ba85556a3d349a716d703b36362d10a7
#3 ERROR: failed to copy: httpReadSeeker: failed open: failed to do request: Get https://southeastasia.data.mcr.microsoft.com/353485d638e24519ae59b2c19249e31f-vd4vgzv6do//docker/registry/v2/blobs/sha256/39/397f9fc13f1cc630bb67dfb3ce67436e81bef757f49f9e75a08941aeb4723d87/data?P1=1620172599&P2=1&P3=1&P4=wqn3RgRodJ2eqV7vHytI2ChS7ZvTriLEm3mZlj6KeVw%3D&se=2021-05-04T23%3A56%3A39Z&sig=RrR44BImH5FWA%2F0WZLRM7THK5ZR8kAX6dSxqACQYn7A%3D&sp=r&spr=https&sr=b&sv=2016-05-31&regid=353485d638e24519ae59b2c19249e31f: EOF

#4 [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:3.1
#4 sha256:6cc59bb059858e4ec7070d9fc240ac93870aa8bdfd5679ab219e693360eb146a
#4 CANCELED

[internal] load metadata for mcr.microsoft.com/dotnet/sdk:3.1:


failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to copy: httpReadSeeker: failed open: failed to do request: Get https://southeastasia.data.mcr.microsoft.com/353485d638e24519ae59b2c19249e31f-vd4vgzv6do//docker/registry/v2/blobs/sha256/39/397f9fc13f1cc630bb67dfb3ce67436e81bef757f49f9e75a08941aeb4723d87/data?P1=1620172599&P2=1&P3=1&P4=wqn3RgRodJ2eqV7vHytI2ChS7ZvTriLEm3mZlj6KeVw%3D&se=2021-05-04T23%3A56%3A39Z&sig=RrR44BImH5FWA%2F0WZLRM7THK5ZR8kAX6dSxqACQYn7A%3D&sp=r&spr=https&sr=b&sv=2016-05-31&regid=353485d638e24519ae59b2c19249e31f: EOF

please find below the sample docker file

FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

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

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

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

Kindly suggest.

@joperezr
Copy link
Member

joperezr commented May 6, 2021

Hello @mukthiarahamad thanks for logging your issue. From the error it seems to be that you were just hitting a network issue when trying to download the base image for the 3.1 sdk, but that seems to be working for me now. Could you try again to see if this is now fixed?

@joperezr joperezr added the needs-more-info Not enough information has been provided. Please share more detail as requested. label May 6, 2021
@mukthiarahamad
Copy link
Author

Hi, I was able to resolve this issue. I have deployed the code in the azure container registry and have hosted it in a container. try to access the same from the client give me an error as below
Grpc.Core.RpcException: 'Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while HTTP/2 is not enabled.", DebugException="System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while HTTP/2 is not enabled.
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync

while I have enabled http2 in the server as below.

webBuilder.ConfigureKestrel(options =>
{
// Setup a HTTP/2 endpoint without TLS.
// options.ListenLocalhost(80, o => o.Protocols =
// HttpProtocols.Http2);
options.ListenAnyIP(5000, o => o.Protocols =
HttpProtocols.Http2);
});
webBuilder.UseStartup();

@no-response no-response bot removed the needs-more-info Not enough information has been provided. Please share more detail as requested. label May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants