diff --git a/src/WireMock.Net.Testcontainers/WireMockContainerBuilder.cs b/src/WireMock.Net.Testcontainers/WireMockContainerBuilder.cs index 16cf55dd5..51282daf2 100644 --- a/src/WireMock.Net.Testcontainers/WireMockContainerBuilder.cs +++ b/src/WireMock.Net.Testcontainers/WireMockContainerBuilder.cs @@ -62,6 +62,29 @@ public WireMockContainerBuilder WithWindowsImage() return WithImage(OSPlatform.Windows); } + /// + /// Sets a custom WireMock.Net image for which to create the container. + /// + /// The image name. + /// A configured instance of + [PublicAPI] + public new WireMockContainerBuilder WithImage(string image) + { + return WithCustomImage(image); + } + + /// + /// Sets a custom WireMock.Net image for which to create the container. + /// + /// The image name. + /// A configured instance of + [PublicAPI] + public WireMockContainerBuilder WithCustomImage(string image) + { + _imageOS ??= TestcontainersUtils.GetImageOSAsync.Value.GetAwaiter().GetResult(); + return base.WithImage(image); + } + /// /// Set the admin username and password for the container (basic authentication). /// diff --git a/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs b/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs index cb1be0500..f3e198931 100644 --- a/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs +++ b/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs @@ -92,7 +92,7 @@ public async Task WireMockContainer_Build_WithImageAsText_And_StartAsync_and_Sto } else { - wireMockContainerBuilder = wireMockContainerBuilder.WithImage("sheyenrath/wiremock.net"); + wireMockContainerBuilder = wireMockContainerBuilder.WithImage("sheyenrath/wiremock.net-alpine"); } var wireMockContainer = wireMockContainerBuilder.Build();