Skip to content

Commit 8e8d416

Browse files
committed
manually add TARGETARCH to TestContainer build
1 parent 18cfbc7 commit 8e8d416

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/AutoInstrumentation.IntegrationTests/ExampleApplicationContainer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5+
using System.Runtime.InteropServices;
56
using DotNet.Testcontainers;
67
using DotNet.Testcontainers.Builders;
78
using DotNet.Testcontainers.Configurations;
@@ -33,6 +34,13 @@ public ExampleApplicationContainer()
3334
.WithDockerfileDirectory(directory, string.Empty)
3435
.WithDockerfile("examples/Example.AutoInstrumentation/Dockerfile")
3536
.WithLogger(ConsoleLogger.Instance)
37+
.WithBuildArgument("TARGETARCH", RuntimeInformation.ProcessArchitecture switch
38+
{
39+
Architecture.Arm64 => "arm64",
40+
Architecture.X64 => "x64",
41+
Architecture.X86 => "x86",
42+
_ => "unsupported"
43+
})
3644
.Build();
3745

3846
_output = Consume.RedirectStdoutAndStderrToStream(new MemoryStream(), new MemoryStream());

0 commit comments

Comments
 (0)