builder.UseContainer()
.UseImage("mcr.microsoft.com/mssql/server:2022-latest")
.WithName(imageName)
.WithHostName("sql")
.WithEnvironment(
@"ACCEPT_EULA=Y",
$@"MSSQL_SA_PASSWORD={options.SaPassword}",
@"MSSQL_PID=Express"
)
.AsUser("root")
.CopyOnStart(createDbScriptPath, @"/src")
.UseWorkDir("/src")
.ExecuteOnRunning(dbCreateScripts.ToArray())
.AsUser("mssql")
.ExposePort(options.Port, 1433)
.UseIpV4("127.0.0.1")
.DeleteIfExists(false, true)
//.WaitForProcess("/opt/mssql-tools/bin/sqlcmd")
//.WaitForPort("1433/tcp", TimeSpan.FromSeconds(10))
.WaitForMessageInLog(
"Recovery is complete. This is an informational message only. No user action is required."
);
The dbCreateScripts.ToArray() contains a couple of commands but one of them is to simply touch a file so I can see if it works.
I get no errors, yet no file appears. And, I can see the other commands aren't executed too.
I have the following setup:
The
dbCreateScripts.ToArray()
contains a couple of commands but one of them is to simplytouch
a file so I can see if it works. I get no errors, yet no file appears. And, I can see the other commands aren't executed too.What am I doing wrong here?