Skip to content

Commit

Permalink
Add port mappings (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <[email protected]>
  • Loading branch information
annymsMthd authored Aug 30, 2017
1 parent 97e6cec commit 8d706dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/LclDckr/Commands/Run/RunArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ public class RunArguments

public string HostName { get; set; }

public IDictionary<string, string> EnvironmentArgs = new Dictionary<string, string>();
public IDictionary<string, string> EnvironmentArgs { get; set; } = new Dictionary<string, string>();

public IList<string> Volumes = new List<string>();
public IList<string> Volumes { get; set; } = new List<string>();

public IDictionary<string, string> PortMappings { get; set; } = new Dictionary<string, string>();

public string ToArgString()
{
Expand Down Expand Up @@ -44,6 +46,11 @@ public string ToArgString()
args.Append($" -v {volume}");
}

foreach (var mapping in PortMappings)
{
args.Append($" -p {mapping.Key}:{mapping.Value}");
}

return args.ToString();
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/LclDckr/DockerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ private Process GetDockerProcess(string arguments)
Arguments = arguments,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false
UseShellExecute = false,
CreateNoWindow = true
}
};
}
Expand Down

0 comments on commit 8d706dc

Please sign in to comment.