Open Trinition opened 2 years ago
Hey @Trinition, thanks a lot for sharing your implementation with the community 🙌
The lack of configurability of the image used by the JdbcDatabaseContainerProvider
is discussed in https://github.com/testcontainers/testcontainers-java/issues/4. As I see it, if we solve this issue, it would solve this issue as well.
MSSQL's JDBC Driver 10.1+ enables encrypt=true
by default, but not trustServerCertificate=true
. You can either add certificate trusting...
return new MSSQLServerContainer(taggedImageName)
.withUrlParam('trustServerCertificate', 'true')
Or disable encrypt...
return new MSSQLServerContainer(taggedImageName)
.withUrlParam('encrypt', 'false')
@Trinition could you please elaborate more how to make image mcr.microsoft.com/azure-sql-edge work with MSSQLServerContainer. I am trying to make it work on my apple M1 pro .. without success so far...
@gmelekh I apologize, but I don't recall what I did. The project I was doing this for got shelved last year, so I'm not currently working on it, and my memory has faded a lot.
@gmelekh the little bi I was able to scape back together:
I am getting this error when try to start the container
com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
On an Apple M1, Microsoft's
mcr.microsoft.com/mssql/server
fails because thesqlcmd
is not supported on ARM64; however, Microsoft makes anmcr.microsoft.com/azure-sql-edge
Azure SQL Edge container that does work and claims to be fully T-SQL compatible (see here).I managed to build my own provider that re-uses the
MSSQLServerContainer
, but with a different image:I had to use a different
databaseType
name (azuresqledge
instead ofsqlserver
) to prevent the two providers from competing. Perhaps there's a better way to avoid that competition without having to change thedatabaseType
name.Or perhaps there's a way to modify
MSSQLServerContainer
/...Provider
to accept either image name.Nonetheless, the above provider works fine with my limited, local testing thus far.