Skip to content

Unable to have tests that use testcontainers running successful in a docker image #733

Answered by HofmeisterAn
joaocpribeiro asked this question in Q&A
Discussion options

You must be logged in to vote

I understand the the tests within the docker image do not know how to communicate with docker

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 docker build. To run Testcontainers in the docker build process see my answer at Stack Overflow

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@joaocpribeiro
Comment options

@HofmeisterAn
Comment options

@joaocpribeiro
Comment options

@HofmeisterAn
Comment options

@joaocpribeiro
Comment options

Answer selected by HofmeisterAn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants