Skip to content

Commit

Permalink
manually add TARGETARCH to TestContainer build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Jul 9, 2024
1 parent 18cfbc7 commit 8e8d416
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System.Runtime.InteropServices;
using DotNet.Testcontainers;
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Configurations;
Expand Down Expand Up @@ -33,6 +34,13 @@ public ExampleApplicationContainer()
.WithDockerfileDirectory(directory, string.Empty)
.WithDockerfile("examples/Example.AutoInstrumentation/Dockerfile")
.WithLogger(ConsoleLogger.Instance)
.WithBuildArgument("TARGETARCH", RuntimeInformation.ProcessArchitecture switch
{
Architecture.Arm64 => "arm64",
Architecture.X64 => "x64",
Architecture.X86 => "x86",
_ => "unsupported"
})
.Build();

_output = Consume.RedirectStdoutAndStderrToStream(new MemoryStream(), new MemoryStream());
Expand Down

0 comments on commit 8e8d416

Please sign in to comment.