Replies: 6 comments 3 replies
-
|
Hello @max2020204,
Make sure your properties are split correctly: dotnet publish -t:PublishContainer \
-p:ContainerRegistry=registry.digitalocean.com \
-p:ContainerRepository=project-data-repository/coursesand that |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for clarifying how creds are picked up. I still can’t get
I also tried setting When I set both username and password to the token (which is how DOCR actually expects login), it still fails with CONTAINER1016. I double-checked that the repo name is lowercase ( So the same credentials that work with docker push are not being picked up by dotnet publish. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply. I’ve tried the things you mentioned but I’m still stuck with CONTAINER1016. |
Beta Was this translation helpful? Give feedback.
-
|
Here's logs, same $ aspirate init
_ _ ___
/ \ ___ _ __ (_) _ __ ( _ )
/ _ \ / __| | '_ \ | | | '__| / _ \
/ ___ \ \__ \ | |_) | | | | | | (_) |
/_/ \_\ |___/ | .__/ |_| |_| \___/
|_|
Handle deployments of a .NET Aspire AppHost
── Handle Initialization Defaults ──────────────────────────────────────────────────────────────────────────────────────
(?) Done: Set 'Container builder' to 'docker'.
Aspirate supports setting a fall-back value for projects that have not yet set a 'ContainerRegistry' in their csproj
file.
Would you like to set a fall-back value for the container registry? [y/n] (n): y
Please enter the container registry to use as a fall-back value: registry.digitalocean.com
(?) Done: Set 'Container fallback registry' to 'registry.digitalocean.com'.
Aspirate supports setting a repository prefix for all for projects.
Would you like to set this value? [y/n] (n): y
Please enter the container repository prefix to use as a fall-back value: funiver-data-repository
(?) Done: Set 'Container repository prefix' to 'funiver-data-repository'.
(?) Done: Set 'Container fallback tag' to 'latest'.
Aspirate supports setting a custom directory for 'Templates' that are used when generating kustomize manifests.
Would you like to use a custom directory (selecting 'n' will default to built in templates ? [y/n] (n): n
(?) Done: Configuration for aspirate has been bootstrapped successfully at
'C:\Users\black\RiderProjects\funiverai\Aspire\FuniverAI.AppHost\.\aspirate.json'.
?? Execution Completed ??
black@DESKTOP-Q1QHG3L MINGW64 ~/RiderProjects/funiverai/Aspire/FuniverAI.AppHost (dev)
$ DOCKER_CONFIG="$HOME/.docker" aspirate build
_ _ ___
/ \ ___ _ __ (_) _ __ ( _ )
/ _ \ / __| | '_ \ | | | '__| / _ \
/ ___ \ \__ \ | |_) | | | | | | (_) |
/_/ \_\ |___/ | .__/ |_| |_| \___/
|_|
Handle deployments of a .NET Aspire AppHost
── Handling Aspirate State ─────────────────────────────────────────────────────────────────────────────────────────────
── Handling Aspirate Secrets ───────────────────────────────────────────────────────────────────────────────────────────
Secrets are to be protected by a password
Please enter new Password:
black@DESKTOP-Q1QHG3L MINGW64 ~/RiderProjects/funiverai/Aspire/FuniverAI.AppHost (dev)
$ docker login registry.digitalocean.com
Authenticating with existing credentials... [Username: [email protected]]
i Info → To login with a different account, run 'docker logout' followed by 'docker login'
Login Succeeded
black@DESKTOP-Q1QHG3L MINGW64 ~/RiderProjects/funiverai/Aspire/FuniverAI.AppHost (dev)
$ DOCKER_CONFIG="$HOME/.docker" aspirate build
_ _ ___
/ \ ___ _ __ (_) _ __ ( _ )
/ _ \ / __| | '_ \ | | | '__| / _ \
/ ___ \ \__ \ | |_) | | | | | | (_) |
/_/ \_\ |___/ | .__/ |_| |_| \___/
|_|
Handle deployments of a .NET Aspire AppHost
── Handling Aspirate State ─────────────────────────────────────────────────────────────────────────────────────────────
── Handling Aspirate Secrets ───────────────────────────────────────────────────────────────────────────────────────────
Secrets are to be protected by a password
Please enter new Password: ********************************
Please enter it again to confirm: ********************************
Secret State has been initialised!.
── Handling Configuration ──────────────────────────────────────────────────────────────────────────────────────────────
Successfully loaded existing aspirate bootstrap settings from '.'.
── Handling Aspire Manifest ────────────────────────────────────────────────────────────────────────────────────────────
Generating Aspire Manifest for supplied App Host
(?) Done: Created Aspire Manifest At Path:
C:\Users\black\RiderProjects\funiverai\Aspire\FuniverAI.AppHost\manifest.json
── Selecting Required Components ───────────────────────────────────────────────────────────────────────────────────────
── Gathering Information about deployables ─────────────────────────────────────────────────────────────────────────────
Gathering container details for each project in selected components
(?) Done: Populated container details cache for project Courses
(?) Done: Populated container details cache for project Lessons
(?) Done: Populated container details cache for project UserCoursesData
(?) Done: Populated container details cache for project UserProfile
(?) Done: Populated container details cache for project BFFTokenExchange
(?) Done: Populated container details cache for project Yarp
Gathering Tasks Completed - Cache Populated.
── Handling Projects ───────────────────────────────────────────────────────────────────────────────────────────────────
Building all project resources, and pushing containers
Executing: dotnet publish
"C:\Users\black\RiderProjects\funiverai\Aspire\FuniverAI.AppHost\../../Courses/FuniverAI.Courses/FuniverAI.Courses.cspro
j" -t:PublishContainer --verbosity "quiet" --nologo -r "linux-x64" -p:ContainerRegistry="registry.digitalocean.com"
-p:ContainerRepository="funiver-data-repository/" -p:ContainerImageName="funiverai.courses" -p:ContainerImageTag="1.0.0"
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses.Infrastructure\Specification\CourseWithAnyTagsSpecifica
tion.cs(12,25): warning CS8604: Possible null reference argument for parameter 'source' in 'bool
Enumerable.Any<CourseTag>(IEnumerable<CourseTag> source, Func<CourseTag, bool> predicate)'.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses.Infrastructure\FuniverAI.Courses.Infrastructure.csproj
]
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\Requests\PostPhotoRequest.cs(6,22): warning CS8618:
Non-nullable property 'Photo' must contain a non-null value when exiting constructor. Consider adding the 'required'
modifier or declaring the property as nullable.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\Requests\PostCourseRequest.cs(5,19): warning CS8618:
Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider adding the 'required'
modifier or declaring the property as nullable.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\Requests\GetCoursesByTagsRequest.cs(5,25): warning
CS8618: Non-nullable property 'Tags' must contain a non-null value when exiting constructor. Consider adding the
'required' modifier or declaring the property as nullable.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\Endpoints\PutCoursesEndpoint.cs(53,23): warning CS8601:
Possible null reference assignment.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\Endpoints\DeleteCoursesEndpoint.cs(53,33): warning
CS8604: Possible null reference argument for parameter 'entity' in 'void
IWriteRepository<CoursesModel>.Delete(CoursesModel entity)'.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\Endpoints\PatchVisibleCoursesEndpoint.cs(51,9): warning
CS8602: Dereference of a possibly null reference.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Program Files\dotnet\sdk\9.0.304\Containers\build\Microsoft.NET.Build.Containers.targets(84,5): warning CONTAINER003:
The property 'ContainerImageName' was set but is obsolete - please use 'ContainerRepository' instead.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
C:\Program Files\dotnet\sdk\9.0.304\Containers\build\Microsoft.NET.Build.Containers.targets(250,5): error CONTAINER1016:
Unable to access the repository 'funiverai.courses' in the registry 'registry.digitalocean.com'. Please confirm your
credentials are correct and that you have access to this repository and registry.
[C:\Users\black\RiderProjects\funiverai\Courses\FuniverAI.Courses\FuniverAI.Courses.csproj]
Error executing action 'BuildAndPushContainersFromProjectsAction': Exception of type
'Aspirate.Shared.Exceptions.ActionCausesExitException' was thrown.
(1): Aspirate will now exit. |
Beta Was this translation helpful? Give feedback.
-
|
Check if there any credential helper, check for "credsStore" or "credHelpers" in the |
Beta Was this translation helpful? Give feedback.
-
|
dotnet/sdk-container-builds#501 Seems like this issue has been around for a while and affects dotnet publish as well |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using Aspirate to generate config and deploy my .NET Aspire solution, but I can’t push my containers to the registry because of a credentials issue.
Steps I take:
Run aspirate init:
registry.digitalocean.comaspirate.jsonis created successfullyRun aspirate build
Error occurs when pushing the image:
error CONTAINER1016: Unable to access the repository 'project-data-repository/courses' in the registry 'registry.digitalocean.com'. Please confirm your credentials are correct and that you have access to this repository and registry.I don’t understand where Aspirate (or the underlying
dotnet publish) is supposed to take registry credentials from.Questions:
dotnet publish -t:PublishContaineractually get credentials for pushing images?Beta Was this translation helpful? Give feedback.
All reactions