Closed richlander closed 1 year ago
This should work better with preview 7.
You can use docker.io
instead of registry-1.docker.io
as the ContainerRegistry
.
And when using the docker login
command without any additional arguments, that should use a key of https://index.docker.io/v1/
in the config.json
file.
The preview 7 SDK will use those credentials for the docker.io
registry.
cc @baronfel
Rich and I spoke about this a bit offline - yes the reuse of docker credentials will get better, but the real issue is that he didn't include his user namespace in the image repository. We didn't doc this explicitly in the configuration docs for ContainerRepository, and the error message doesn't help guide users to a resolution.
I tried ContainerRepository
and then that sort of worked. I got a ton of these:
Encountered a SocketException with message "Broken pipe". Pausing before retry.
Which ended in:
/usr/local/share/dotnet/sdk/8.0.100-preview.6.23330.14/Containers/build/Microsoft.NET.Build.Containers.targets(201,5): error CONTAINER1013: Failed to push to the output registry: CONTAINER1006: Too many retries, stopping. [/Users/rich/git/dotnet-docker/samples/aspnetapp/aspnetapp/aspnetapp.csproj]
I'll try again later with the suggestion from @tmds.
Working now!
My test:
$ docker login -u richlander
$ dotnet publish /p:PublishProfile=DefaultContainer /p:ContainerBaseImage=mcr.microsoft.com/dotnet/aspnet:8.0-preview-jammy-chiseled /p:ContainerRegistry=docker.io /p:ContainerRepository=richlander/foo
Thanks for the help!
For anyone looking at this later, I use Docker PATs for my password since I have 2FA enabled. Works great.
This is what I'm doing. Is the
credsStore
the problem? This is macOS. However, I'm having similar troubles with Linux which have the actual key listed.I used these docs to help me: https://github.com/dotnet/sdk-container-builds/blob/main/docs/RegistryAuthentication.md
On Linux, my
config.json
looks like this: