I am trying to create a sql server docker container using the docker api via Docker.DotNet
The powershell to do this according to this guide is as follows
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong!Passw0rd>" `
-p 1433:1433 --name sql1 `
-d microsoft/mssql-server-linux:2017-latest
I have the following code which creates a container
public async Task StartAsync()
{
await client.Containers.StartWithConfigContainerExecAsync(Id, new ContainerExecStartParameters
{
Env = new List<string> { "ACCEPT_EULA=Y", $"SA_PASSWORD={SaPassword}" },
});
}
but I cannot figure out how to pass the -p
, --name
, and -d
parameters, and can not figure out from the docs how this is supposed to be done