Unable to have tests that use testcontainers running successful in a docker image #733
-
In older projects I have been running our tests in a docker image in devops build pipeline. While investigating, I found this discussion, which might have similarities, but it did not help me so far. Taking that discussion, I decided to use @HofmeisterAn example (code here). When I run these tests locally with If I add the following dockerfile, I get an error while building it.
Call: Error:
My knowledge in docker is not deep. I understand the the tests within the docker image do not know how to communicate with docker to manage the testcontainers, but I do not know what I should configure as Could someone please guide me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Kind of, yes. Your Docker image does not include Docker. You need to expose a Docker endpoint. Either via TCP or something like Docker-in-Docker (DinD). #492 (comment) explains two different DinD approaches. Maybe the Docker Desktop Compose example helps to understand the pattern for sibling containers too. @kiview |
Beta Was this translation helpful? Give feedback.
Kind of, yes. Your Docker image does not include Docker. You need to expose a Docker endpoint. Either via TCP or something like Docker-in-Docker (DinD). #492 (comment) explains two different DinD approaches. Maybe the Docker Desktop Compose example helps to understand the pattern for sibling containers too. @kiview
do you have a more detailed example? Although, I am not sure how to do it during. To run Testcontainers in thedocker build
docker build
process see my answer at Stack Overflow