MsSqlTestcontainer with azure-sql-edge image does not start on ARM64 (Mac M1)
See original GitHub issueI’ve tried MsSqlTestcontainer with mcr.microsoft.com/azure-sql-edge but it won’t start.
var testcontainersBuilder = new TestcontainersBuilder<MsSqlTestcontainer>()
.WithDatabase(new MsSqlTestcontainerConfiguration()
{
Password = "StrongP@ssw0rd!"
})
.WithImage("mcr.microsoft.com/azure-sql-edge");
var testcontainer = testcontainersBuilder.Build();
testcontainer.StartAsync().Wait();
I’ve figured it out that the reason of that behavior is because sqlcmd tool is not available inside the ARM64 version of SQL Edge containers according to docker image description (https://hub.docker.com/_/microsoft-azure-sql-edge). But sqlcmd is necessary to verify that the container has started (see file: MsSqlTestcontainerConfiguration.cs):
public override IWaitForContainerOS WaitStrategy => Wait.ForUnixContainer()
.UntilCommandIsCompleted($"/opt/mssql-tools/bin/sqlcmd -S 'localhost,{this.DefaultPort}' -U '{this.Username}' -P '{this.Password}'");
Questions:
1a) Should it be treated as an error of handling ARM64 image?
or maybe
1b) Should it be treated as a different Testcontainer, something like AzureSqlEdgeTestcontainer?
2) What other alternative of WayStrategy can be used in this particular case?
Currently it is the only docker image that runs on M1 macs from the hole MS SQL Server family. Please help.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8

Top Related StackOverflow Question
BTW, I was able to make custom Azure SQL Edge image, that contains simple
sqlcmdtool on ARM64. See my repo for more details: https://github.com/cagrin/azure-sql-edge-arm64With
cagrin/azure-sql-edge-arm64image it is now possible to simple useMsSqlTestcontaineron ARM64 (M1 Mac).@HofmeisterAn you are right. That’s how new I was! I did manage to add a little custom code to get Azure SQL Edge working with
testcontainers-java, but the whole container-wait mechanism is different there, so it’s a different solution that what’s presented here.