Aspire do prepare-compose + aspire do push generate different tags #14525
-
|
I'm using Here's my setup: var builder = DistributedApplication.CreateBuilder(args);
var imageTag = Environment.GetEnvironmentVariable("IMAGE_TAG") ?? "dev"; // commit SHA in CI
var compose = builder.AddDockerComposeEnvironment("compose")
.WithDashboard(dashboard => dashboard.WithHostPort(8080));
var registry = builder.AddContainerRegistry(
"gitlab",
"gitlab..nl:5050",
"namespace/project")
.WithImagePushOptions(options => options.Options.RemoteImageTag = imageTag);My understanding is that Is there a way to make As a workaround I'm currently doing a sed replace on the generated file, but that's obviously not ideal: IMAGE_TAG=$(git rev-parse --short HEAD)
aspire do prepare-compose
sed -i "s|:20[0-9]\{6\}|:$IMAGE_TAG|g" docker-compose.yaml
aspire do push |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
Try WithImagePushOptions on the project itself, not the container registry |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
The problematic code appears to be here: This isn't respecting the annotation and instead returning the placeholder to be filled in by the parameter. @thomasreuvers - can you open an issue for this? |
Beta Was this translation helpful? Give feedback.
The problematic code appears to be here:
https://github.com/dotnet/aspire/blob/5b9f8167456454515a463693f8661c1abe7e07a6/src/Aspire.Hosting.Docker/DockerComposeServiceResource.cs#L134-L145
This isn't respecting the annotation and instead returning the placeholder to be filled in by the parameter.
@thomasreuvers - can you open an issue for this?