I’m running code in docker containers for development and releases. I have a docker-compose configuration to start the database and run tests against it, and it works really well, but… When I run the same docker-compose, using the same images, in Gitlab-ci or in a Virtualbox VM on my laptop, I get something like up to 1% of my tests failing. If I run the tests over and over, I get errors 95% of the time, and not on the same tests.
The docker image I use for my tests is based on “bitwalker/alpine-elixir-phoenix” (so with Alpine Linux).
Running the same tests with a docker image based on ubuntu, I get no error. I find strange that Alpine in a container could behave differently depending on the host, but that’s the only beginning of explanation I have thus far. Does it make any sense?
To recap, here a the different configurations I tried, running the exact same code, several times in a row:
- docker-compose, alpine based image, running locally on my laptop: no failing test,
- docker-compose, alpine based image, in a VM (Virtualbox on my laptop, or in Gitlab-ci): tests fail randomly,
- docker-compose, ubuntu based image, in a VM (Virtualbox on my laptop, or in Gitlab-ci): no failing test.
Any help would be greatly appreciated!