DockerImageNotFoundException when running integration tests in Azure DevOps pipeline #894
-
Hi all! I'm very new to TestContainers and Docker, and also pretty inexperienced when it comes to Azure DevOps pipelines, so this will probably be a silly question, but here we go. As a POC using Testcontainers.MsSql version 3.1.0, I wrote some tests that use the standard SQL Server module as part of the ClassInitialize method: var msSqlContainer = new MsSqlBuilder()
.WithPortBinding(6969, 1433)
.WithPassword("password")
.Build();
await msSqlContainer.StartAsync(); This works fine locally with Docker Desktop. However, when I run these tests as a part of our Azure DevOps CI/CD pipeline, I get the following error:
Stack trace:
Does anybody have any idea what could be the cause of this? Now keep in mind, I'm new to TestContainers and also far from a Azure DevOps pipeline expert, so the problem could be something very simple. The problem seems to be related to #519 or #424. I guess my first question would be: what would it normally take to get a test with TestContainers to pass in a CI/CD pipeline? Locally, all I had to do was install Docker Desktop. Is there an equivalent thing I need to configure for setting this up in Azure DevOps? I tried looking for a simple example of how to set up TestContainers for your CI/CD pipeline, but unfortunately I haven't been able to find anything. If there is such an example, please let me know. Thank you for your time. If there's any more information you need from me, please let me know! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
All you need is an installation of Docker. If you are using the Microsoft-hosted agents, Docker is pre-installed, and there is no need for any additional configuration. Considering your stack trace, it looks like you are using a Windows agent, right? The Windows agents cannot run Linux container. There is no Windows (multi-platform) image for MSSQL. Can you please run your build on ubuntu-22.04? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick answer, I'll look into it! |
Beta Was this translation helpful? Give feedback.
All you need is an installation of Docker. If you are using the Microsoft-hosted agents, Docker is pre-installed, and there is no need for any additional configuration.
Considering your stack trace, it looks like you are using a Windows agent, right? The Windows agents cannot run Linux container. There is no Windows (multi-platform) image for MSSQL. Can you please run your build on ubuntu-22.04?