-
-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#94] #IMPLEMENT 'assemblyName: DotNet.Testcontainers; function: Dock…
…erHostConfiguration' {Add new property IsWindowsEngineEnabled to query running Docker engine.}
- Loading branch information
1 parent
f32beb6
commit 3fdac9b
Showing
6 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace DotNet.Testcontainers.Clients | ||
{ | ||
using System; | ||
|
||
internal sealed class MetaDataClientSystem : DockerApiClient | ||
{ | ||
private static readonly Lazy<MetaDataClientSystem> MetaDataClient = new Lazy<MetaDataClientSystem>(() => new MetaDataClientSystem()); | ||
|
||
private MetaDataClientSystem() | ||
{ | ||
} | ||
|
||
internal static MetaDataClientSystem Instance | ||
{ | ||
get | ||
{ | ||
return MetaDataClient.Value; | ||
} | ||
} | ||
|
||
internal bool IsWindowsEngineEnabled { get; } = "Windows_NT".Equals(Docker.System.GetSystemInfoAsync().Result.OperatingSystem); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/DotNet.Testcontainers/Core/Builder/DockerHostConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace DotNet.Testcontainers.Core.Builder | ||
{ | ||
using DotNet.Testcontainers.Clients; | ||
|
||
public static class DockerHostConfiguration | ||
{ | ||
public static bool IsWindowsEngineEnabled => MetaDataClientSystem.Instance.IsWindowsEngineEnabled; | ||
} | ||
} |