Spinning up MsSql db from image with Database in place no tables or procedures present #707
-
I am using XUNIT to write integration tests and have created a docker image with my database in place. I can connect to the container and see my database and objects all in place. My image was based on SQL Server 2019 latest then my database backup was restored to this image and has been committed and tagged. I am using my image in my tests but noticed in the containers it starts 2 containers for images testcontainers/ryuk:0.3.4 and mcr.microsoft.com/mssql/server:2017-CU28-ubuntu-16.04. I would have expected it to use 2019 SQL server version as in my image? When I run the tests I see the above mentioned containers start and I can connect to the database in SQL Management studio. I drill down to the database name that I added to my image but there are no objects within it. I am using the following code
Does anybody have any ideas? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You override the image configuration with the default module configuration, try the following: |
Beta Was this translation helpful? Give feedback.
-
Thank you! Works like a dream |
Beta Was this translation helpful? Give feedback.
You override the image configuration with the default module configuration, try the following:
WithDatabase(new MsSqlTestcontainerConfiguration(image) { Database = "dbname", Password = "SomePassword" })