dotnet / sdk-container-builds

Libraries and build tooling to create container images from .NET projects using MSBuild

Home Page:https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publish to yandex container registry

leotsarev opened this issue · comments

Hello @leotsarev I don't know of any reason why we can't work with a Yandex registry, but I have not been able to test because I cannot create a billing account from my country. If you are able to test the tooling with Yandex and provide feedback either way, we would document that.

@baronfel it isn't working, actually.
I'm passing

<ContainerRuntimeIdentifier>linux-x64</ContainerRuntimeIdentifier>
<ContainerRegistry>cr.yandex/crp3fr717nr1rn78qeij/</ContainerRegistry>

(tried both cr.yandex/crp3fr717nr1rn78qeij/ and cr.yandex/crp3fr717nr1rn78qeij)

Seems that ContainerHelpers.IsValidRegistry doesn't allow paths in registry name.

I could provide your with test registry, if you want. You have to register yandex account and I'll give you access. Put email for this account here or email me to leo@leotsarev.ru or ping using telegram @leotsarev

I cannot create a billing account from my country.

My friends from abroad says it should be possible. Just tested and it's possible i.e. from Serbia (so it's possible from "international" side of sanctions wall).

@leotsarev ah, for registries with paths, you use the 'base' registry name for ContainerRegistry, and you prepend the path portion to ContainerImageName. Google Cloud does the same thing, here's an example: https://github.com/baronfel/sdk-container-demo/blob/main/Properties/PublishProfiles/gcp.pubxml

Thanks for your patience!
it's still not working for me:

C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: Failed to push to the output registry: System.ApplicationException
: CONTAINER1001: Failed to upload blob to Chunked PATCH https://cr.yandex/v2/crp3fr717nr1rn78qeij/twilight-web/blobs/uploads/crp0okqeje53kd5ss481; received RequestedRangeNotSatisfiable with detail Date: Tue,
06 Jun 2023 15:15:48 GMT [C:\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: X-Request-ID: 3a74eca5-a0ad-4e6d-8d95-04ceb49d9d75 [C:\Users\leo\s
ource\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: docker-distribution-api-version: registry/2.0 [C:\Users\leo\source
\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: x-server-trace-id: be7a793b1cfc6c9d:9f91a1d83e9003eb:be7a793b1cfc6
c9d:1 [C:\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: Server: ycalb [C:\Users\leo\source\repos\leotsarev\TwilightRandom\
Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:  [C:\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\
Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: {"errors":[{"code":"UNSUPPORTED","message":"Invalid range: range s
tart 0 is out of order, 65536 expected ; requestId = 3a74eca5-a0ad-4e6d-8d95-04ceb49d9d75"}]}. [C:\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:    at Microsoft.NET.Build.Containers.Registry.UploadBlobChunkedAsy
nc(String repository, String digest, Stream contents, HttpClient client, UriBuilder uploadUri, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry.cs:line 372 [C:
\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:    at Microsoft.NET.Build.Containers.Registry.UploadBlobAsync(Stri
ng repository, String digest, Stream contents, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry.cs:line 487 [C:\Users\leo\source\repos\leotsarev\TwilightRandom
\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:    at Microsoft.NET.Build.Containers.Registry.PushAsync(Layer laye
r, String repository, Action`1 logProgressMessage, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry.cs:line 332 [C:\Users\leo\source\repos\leotsarev\TwilightRa
ndom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:    at Microsoft.NET.Build.Containers.Registry.<>c__DisplayClass51_
0.<<PushAsync>b__0>d.MoveNext() in /_/src/Containers/Microsoft.NET.Build.Containers/Registry.cs:line 564 [C:\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013: --- End of stack trace from previous location --- [C:\Users\leo\so
urce\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:    at Microsoft.NET.Build.Containers.Registry.PushAsync(BuiltImage
 builtImage, ImageReference source, ImageReference destination, Action`1 logProgressMessage, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry.cs:line 575 [C:\U
sers\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csproj]
C:\Users\leo\.nuget\packages\microsoft.net.build.containers\7.0.302\build\Microsoft.NET.Build.Containers.targets(195,5): error CONTAINER1013:    at Microsoft.NET.Build.Containers.Tasks.CreateNewImage.ExecuteA
sync(CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 127 [C:\Users\leo\source\repos\leotsarev\TwilightRandom\Twilight.Web\Twilight.Web.csp
roj]

I tried to disable SDK_CONTAINER_REGISTRY_CHUNKED_UPLOAD but it's not working for me

It works now (after bump from 7.0.302 to 7.0.401)

Great to hear it @leotsarev!