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

type: dict
    version_added: 2.4
  user:
    description:
      - Sets the username or UID used and optionally the groupname or GID for the specified command.
      - "Can be of the forms C(user), C(user:group), C(uid), C(uid:gid), C(user:gid) or C(uid:group)."
    type: str
  uts:
    description:
      - Set the UTS namespace mode for the container.
    type: str
  volumes:
    description:
      - List of volumes to mount within the container.
      - "Use docker CLI-style syntax: C(/host:/container[:mode])"
      - "Mount modes can be a comma-separated list of various modes such as C(ro), C(rw), C(consistent),
        C(delegated), C(cached), C(rprivate), C(private), C(rshared), C(shared), C(rslave), C(slave), and
        C(nocopy). Note that the docker daemon might not support all modes and combinations of such modes."
      - SELinux hosts can additionally use C(z) or C(Z) to use a shared or private label for the volume.
      - "Note that Ansible 2.7 and earlier only supported one mode, which had to be one of C(ro), C(rw),
        C(z), and C(Z)."
    type: list
    elements: str
  volume_driver:
    description:
      - The container volume driver.
    type: str
  volumes_from:
    description:
      - List of container names or IDs to get volumes from.