As per the docs the following should override the image defined health check. But it fails to override the image defined health check. This is important where the image defined health check is not applicable. One such example is using the creating a MySQL cluster in that the default health check is against mysqld which is not appropriate because either ndbd or ndb_mgmd is appropriate.

This leaves the container marked as unhealthy.

Using;

healthcheck:
  test: ["NONE"]

If you use the above to launch MySQL the default health check is used, inspect output following.

            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "/healthcheck.sh"
                ]
            },

Resulting in;

21b30279e77d        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh mysq…"   3 minutes ago       Up 2 minutes (healthy)     1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql
0fb50981bba5        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh ndbd"    3 minutes ago       Up 3 minutes (unhealthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql-ndbd-2
8746135e3f8e        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh ndbd"    3 minutes ago       Up 3 minutes (unhealthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql-ndbd-1
420fb8249df8        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh ndb_…"   3 minutes ago       Up 3 minutes (healthy)     1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql-mgmd

The work around is to call a stub shell which simply calls exit 0.

    healthcheck:
      test: ["CMD-SHELL", "{{ mysql_config_directory }}/healthcheck.sh"]

Resulting in;

            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "/etc/cell/dev/mysql/healthcheck.sh"
                ]
            },
 And;

aaf28f87abf0        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh mysq…"   3 minutes ago       Up 3 minutes (healthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql
2df7948c37fc        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh ndbd"    3 minutes ago       Up 3 minutes (healthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql-ndbd-2
1a3cd97cfc80        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh ndbd"    3 minutes ago       Up 3 minutes (healthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql-ndbd-1
5fea532ef20f        mysql/mysql-cluster:8.0.18                          "/entrypoint.sh ndb_…"   3 minutes ago       Up 3 minutes (healthy)   1186/tcp, 2202/tcp, 3306/tcp, 33060/tcp                                  dev-mysql-mgmd

- Must be a dictionary specifying for an option one of the keys C(strict), C(ignore)
        and C(allow_more_present).
      - If C(strict) is specified, values are tested for equality, and changes always
        result in updating or restarting. If C(ignore) is specified, changes are ignored.
      - C(allow_more_present) is allowed only for lists, sets and dicts. If it is
        specified for lists or sets, the container will only be updated or restarted if
        the module option contains a value which is not present in the container's
        options. If the option is specified for a dict, the container will only be updated
        or restarted if the module option contains a key which isn't present in the
        container's option, or if the value of a key present differs.
      - The wildcard option C(*) can be used to set one of the default values C(strict)
        or C(ignore) to *all* comparisons which are not explicitly set to other values.
      - See the examples for details.
    type: dict
    version_added: "2.8"
  container_default_behavior:
    description:
      - Various module options used to have default values. This causes problems with
        containers which use different values for these options.
      - The default value is C(compatibility), which will ensure that the default values
        are used when the values are not explicitly specified by the user.
      - From Ansible 2.14 on, the default value will switch to C(no_defaults). To avoid
        deprecation warnings, please set I(container_default_behavior) to an explicit
        value.
      - This affects the I(auto_remove), I(detach), I(init), I(interactive), I(memory),
        I(paused), I(privileged), I(read_only) and I(tty) options.
    type: str
    choices:
      - compatibility
      - no_defaults