Docker.DotNet
Docker.DotNet copied to clipboard
How to specify config when creating a service
Hi,
I want to speficy a config when creating a service. like this: docker service create -p 5000:80 --name test --config src=testConfig,target="app/testconfig.txt" myImage
How can I pass the configuration in the following code?
There seems to be no possibility to specify this
await client.Swarm.CreateServiceAsync(new ServiceCreateParameters()
{
Service = new ServiceSpec()
{
TaskTemplate = new TaskSpec
{
ContainerSpec = new ContainerSpec()
{
Image = "mirasoftde/test:aspnetapp"
}
},
EndpointSpec = new EndpointSpec()
{
Ports = new List<PortConfig>()
{
new PortConfig() { Name = "HTTP", Protocol = "tcp", TargetPort = 80, PublishedPort = 5000, PublishMode = "ingress" }
}
},
Name = name
}
});
Unfortunately the version of the Docker API this library supports ATM didn't have this option. It will require a version update but I will add this as a feature request for the next version.
Hi, is there anything blocking/preventing this to be added? And in general, anything that explains why there has been no new feature or release in quite a few months?
think this can be closed RE https://github.com/dotnet/Docker.DotNet/issues/609