diff --git a/.vscode/settings.json b/.vscode/settings.json
index 088f113..48b9296 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,31 +1,33 @@
{
"cSpell.words": [
- "Ductus",
- "Exploaded",
- "Ipam",
- "LOCALAPPDATA",
- "Miscellanious",
- "NOPASSWD",
- "Npgsql",
- "Toffia",
"appconfig",
"archve",
"behaviour",
"compsed",
+ "cref",
"dont",
+ "Ductus",
"editorconfig",
+ "Exploaded",
"flaviours",
"fluentdockerdl",
"fluentdockertest",
+ "Imageverficiation",
+ "Ipam",
"kiasaki",
+ "LOCALAPPDATA",
"lxss",
"mariotoffia",
"martoffi",
+ "Miscellanious",
"mkdir",
"myimg",
"mysecretpassword",
"mytag",
"nodetest",
+ "NOPASSWD",
+ "Npgsql",
+ "npipe",
"nuget",
"particulary",
"postgres",
@@ -34,6 +36,9 @@
"proto",
"somewordpress",
"sudoer",
+ "tlscacert",
+ "tlscert",
+ "Toffia",
"typeof",
"wdlp"
],
diff --git a/Ductus.FluentDocker/Extensions/CommandExtensions.cs b/Ductus.FluentDocker/Extensions/CommandExtensions.cs
index eeb3592..554fc1a 100644
--- a/Ductus.FluentDocker/Extensions/CommandExtensions.cs
+++ b/Ductus.FluentDocker/Extensions/CommandExtensions.cs
@@ -22,7 +22,7 @@ public static class CommandExtensions
///
/// Reads a until is set to true
- /// or a timeout occured on a read.
+ /// or a timeout occurred on a read.
///
/// The type of returned items in the console stream.
/// The stream to read from.
@@ -195,10 +195,10 @@ public static IPAddress EmulatedNativeAddress(bool useCache = true)
return _cachedDockerIpAddress;
}
- internal static string RenderBaseArgs(this Uri host, ICertificatePaths certificates = null)
+ internal static string RenderBaseArgs(this DockerUri host, ICertificatePaths certificates = null)
{
var args = string.Empty;
- if (null != host)
+ if (null != host && !host.IsStandardDaemon)
{
args = $" -H {host}";
}
diff --git a/Ductus.FluentDocker/Model/Common/DockerUri.cs b/Ductus.FluentDocker/Model/Common/DockerUri.cs
index c8d0688..1344079 100644
--- a/Ductus.FluentDocker/Model/Common/DockerUri.cs
+++ b/Ductus.FluentDocker/Model/Common/DockerUri.cs
@@ -13,6 +13,8 @@ public sealed class DockerUri : Uri
public DockerUri(string uriString) : base(uriString)
{
+ if (uriString == DockerHostUrlMacOrLinux || uriString == DockerHostUrlWindowsNative)
+ this.IsStandardDaemon = true;
}
public static string GetDockerHostEnvironmentPathOrDefault()
@@ -31,6 +33,15 @@ public static string GetDockerHostEnvironmentPathOrDefault()
return CommandExtensions.IsToolbox() ? DockerHostUrlLegacy : DockerHostUrlMacOrLinux;
}
+ ///
+ /// Returns true if the DockerUri has a "standard" daemon URI.
+ ///
+ /// True if standard daemon, false otherwise.
+ ///
+ /// If it is a standard daemon URI, there's no need to add the -H flag
+ ///
+ public bool IsStandardDaemon {get;}
+
public override string ToString()
{
var baseString = base.ToString();