They can be easily tested with docker compose up --wait oracle for a docker-compose.yaml like below:
services:
oracle:
image: oracle:21.3.0
The outcome is that the command will return a failure before Oracle DB gets initialized. That's because the default HEALTHCHECK which comes with the Dockerfiles simply aren't sufficient for the first initialization.
By default, it disregards the first 5 minutes of tries (--start-period), then try 3 times (the default --retries) with 1 minute of interval, and gives up (puts the container in unhealthy state, which causes docker-compose --wait to exit with an error).
In my tests, it almost always takes at least 9 minutes in the first initialization. The default healthcheck gives up at 7-8 minutes.
I fixed this issue in my docker-compose.yaml by adding:
I understand that the HEALTHCHECK is something meant to be customized by the end-user according to their needs, but I also believe that we can come up with a better default. I'm testing the database without any customization (no initdb), and in a powerful machine (16 CPUs + 64GB of RAM).
I'm opening this issue instead of just simply sending a PR because I don't know which option is the best:
They can be easily tested with
docker compose up --wait oracle
for adocker-compose.yaml
like below:The outcome is that the command will return a failure before Oracle DB gets initialized. That's because the default HEALTHCHECK which comes with the Dockerfiles simply aren't sufficient for the first initialization.
By default, it disregards the first 5 minutes of tries (--start-period), then try 3 times (the default --retries) with 1 minute of interval, and gives up (puts the container in
unhealthy
state, which causesdocker-compose --wait
to exit with an error).In my tests, it almost always takes at least 9 minutes in the first initialization. The default healthcheck gives up at 7-8 minutes.
I fixed this issue in my
docker-compose.yaml
by adding:I understand that the HEALTHCHECK is something meant to be customized by the end-user according to their needs, but I also believe that we can come up with a better default. I'm testing the database without any customization (no initdb), and in a powerful machine (16 CPUs + 64GB of RAM).
I'm opening this issue instead of just simply sending a PR because I don't know which option is the best:
What do you guys think?