oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.47k stars 5.41k forks source link

Default HEALTHCHECKs for 19c and 21c aren't enough for first initialization #2462

Open felipecrs opened 1 year ago

felipecrs commented 1 year ago

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:

services:
  oracle:
    image: oracle:21.3.0
  healthcheck:
    retries: 10

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?

felipecrs commented 1 year ago

I just tested here, 19.3.0 takes almost 20 minutes to start for the first time (21.3.0 takes 10 minutes as mentioned).