I'm writing these notes because I spent a significant amount of time on a situation related with how docker and docker-compose work, specifically in integration tests. I've learned a few things about how docker that might be useful to remember at the next occasion.
If you use docker-compose
for your integration tests, you might end up in a situation where you have erratic tests because,
while tests are run, some containers are not yet doing what they are supposed to do.
For example, you might have a docker-compose.yml
that sets up kafka
, zookeeper
and postgres
and then you want to run your application
that connects to these systems. Likely your build pipeline will follow these steps: