Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecuteOnRunning doesn't seem to do anything #283

Open
Marvin-Brouwer opened this issue Feb 24, 2023 · 0 comments
Open

ExecuteOnRunning doesn't seem to do anything #283

Marvin-Brouwer opened this issue Feb 24, 2023 · 0 comments

Comments

@Marvin-Brouwer
Copy link

I have the following setup:

			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.

What am I doing wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant