I try to use NET CORE package https://github.com/dotnet/Docker.DotNet to start docker container from NET CORE. Usually my command line looks as
sudo docker run -it \
--name digiwage.$(date +%Y-%m-%d-%H.%M.%S) \
--expose='46003' \
-p '157.XX.XX.85:46003:46003' \
XXXXXX/daemon:latest
following docker documentation https://docs.docker.com/engine/reference/run/#expose-incoming-ports docker has are two parameters related to port
--expose=[] Expose a port or a range of ports inside the container
-p=[] Publish a container's port or a range of ports to the host
First one is docker exposed port list, second one is ports publishing to docker host. This is different meaning, for example docker host can have a lot of IP address and we need to publish port only to one IP.
I try to start container in this way
Dim ExposedPorts = New Dictionary(Of String, EmptyStruct)
ExposedPorts.Add("157.XX.XX.85:46004:46004", New EmptyStruct)
Dim Prm = New CreateContainerParameters With {
.Image = "alexev275/digiwage:latest",
.Name = $"digiwage.{Guid.NewGuid}",
.Env = New List(Of String),
.ExposedPorts = ExposedPorts,
.Tty = True
}
and see in console zero as docker port parameters
I have expected two parameters related to port in CreateContainerParameters, but no, second parameters is absent.


