Custom MsSqlContainer will not start - The sqlcmd binary could not be found. #1255
-
We are using .NET Framework for legacy apps, and trying to run integration tests in Devops with Testcontainers. We need to use Windows build agent, and consequently we need a Windows Docker image for SQL Server 2022 Developer. I have built one that works, and the command line tools are installed as part of the installation (I've checked - I can run sqlcmd from a command prompt in the container). However, when I try to start the container with MsSqlContainer, the container starts - but then I think a health check using 'sqlcmd' is run, at which point I get: System.NotSupportedException : The sqlcmd binary could not be found. I can see that the default wait strategy uses a unix path to search for 'sqlcmd' inside the container, in the FindSqlCmdFilePathAsync() method. Can this be overridden for a Windows SQL installation like mine? Any help appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Apologies, I should have dug deeper before asking. Solved by using .WithWaitStrategy(Wait.ForWindowsContainer().UntilPortIsAvailable(1433)) |
Beta Was this translation helpful? Give feedback.
Apologies, I should have dug deeper before asking. Solved by using .WithWaitStrategy(Wait.ForWindowsContainer().UntilPortIsAvailable(1433))