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

Using .AddDockerfile() forces the resource name to be lowercase #7462

Closed
1 task done
sfields-metabolon opened this issue Feb 7, 2025 · 0 comments · Fixed by #7472
Closed
1 task done

Using .AddDockerfile() forces the resource name to be lowercase #7462

sfields-metabolon opened this issue Feb 7, 2025 · 0 comments · Fixed by #7472
Assignees
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Milestone

Comments

@sfields-metabolon
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

All of the resources in my Aspire project have names that are using PascalCase. I tried adding a new resource that is built from a Dockerfile, but I'm getting the error invalid tag "MyResourceName-image-b3a94344fc439fed1ba4f80c352c4fb0417a6162:latest": repository name must be lowercase.

This happens because the WithDockerfile() extension is using the name of the resource to generate the name of the docker image, but it does not provide a way to separate the naming of the image from the name of the resource.

Expected Behavior

The AddDockerfile() and WithDockerfile() extensions should provide an overload that allows users to influence the naming of the image so that it does not have to be tied to the naming of the Resource.

Steps To Reproduce

var builder = DistributedApplication.CreateBuilder(args);

builder.AddDockerfile("MyResourceName", ".");

builder.Build().Run();

Exceptions (if any)

invalid tag "MyResourceName-image-b3a94344fc439fed1ba4f80c352c4fb0417a6162:latest": repository name must be lowercase

.NET Version info

.NET SDK:
 Version:           9.0.102
 Commit:            cb83cd4923
 Workload version:  9.0.100-manifests.43af17c7
 MSBuild version:   17.12.18+ed8c6aec5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.102\

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.1
  Architecture: x64
  Commit:       c8acea2262

.NET SDKs installed:
  8.0.405 [C:\Program Files\dotnet\sdk]
  9.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

.NET Aspire Version: 9.0.0

@davidfowl davidfowl added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Feb 7, 2025
@DamianEdwards DamianEdwards self-assigned this Feb 7, 2025
@DamianEdwards DamianEdwards added this to the 9.1 milestone Feb 7, 2025
@davidfowl davidfowl added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Feb 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants