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

[Enhancement]: Support for digest in the image definition #1214

Closed
Kielek opened this issue Jul 16, 2024 · 0 comments · Fixed by #1249
Closed

[Enhancement]: Support for digest in the image definition #1214

Kielek opened this issue Jul 16, 2024 · 0 comments · Fixed by #1249
Labels
enhancement New feature or request

Comments

@Kielek
Copy link
Contributor

Kielek commented Jul 16, 2024

Problem

OpenTelemetry recommend to reference all docker images by the name, tag, followed by the digest.
Part of implementing this recommendation is open-telemetry/opentelemetry-dotnet-instrumentation#3514

Passing full name to the Container API leads to

System.ArgumentException
Cannot parse image: confluentinc/cp-zookeeper:7.6.1@sha256:4dc780642bfc5ec3a2d4901e2ff1f9ddef7f7c5c0b793e1e2911cbfb4e3a3214 (Parameter 'image')
   at DotNet.Testcontainers.Images.MatchImage.Match(String image) in /_/src/Testcontainers/Images/MatchImage.cs:line 34
   at DotNet.Testcontainers.Images.DockerImage..ctor(String image) in /_/src/Testcontainers/Images/DockerImage.cs:line 41
   at DotNet.Testcontainers.Builders.ContainerBuilder`3.WithImage(String image) in /_/src/Testcontainers/Builders/ContainerBuilder`3.cs:line 67
   at IntegrationTests.KafkaFixture.LaunchZookeeper(INetwork containerNetwork) in C:\GitHub\opentelemetry-dotnet-instrumentation\test\IntegrationTests\KafkaCollection.cs:line 63
   at IntegrationTests.KafkaFixture.InitializeAsync() in C:\GitHub\opentelemetry-dotnet-instrumentation\test\IntegrationTests\KafkaCollection.cs:line 39
   at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90

Solution

Support for following code:

        var container = new ContainerBuilder()
            .WithImage("confluentinc/cp-zookeeper:7.6.1@sha256:4dc780642bfc5ec3a2d4901e2ff1f9ddef7f7c5c0b793e1e2911cbfb4e3a3214")
            .Build();

Benefit

Possibility to define docker image together with its digest.

Alternatives

N/A

Would you like to help contributing this enhancement?

Maybe, depends on the level of complexity. Any guidance of your expectations is more than welcomed.

@Kielek Kielek added the enhancement New feature or request label Jul 16, 2024
@Kielek Kielek changed the title [Enhancement]: [Enhancement]: Support for digest in the image definition Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant