Skip to content

Problem checking healthy state - Docker docs php sample #2

Open

Description

@Glifaus

Hi!

I'm following the docker php sample guide but having problems checking the healthy state.

These are the lines in the docs:
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
But, unfortunatly, don't work. db-server is unhealthy and cannot let server to fully load and serve php.

Instead, if i change these lines for others:
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 3

I can run the demo without problems.

After search i try many options, like in mariadb official docs are information about not using '--su-mysql' or using 'healthcheck.sh' without path, only sh file, but none of them work.

I cannot find why this fail and my attemp works.

Running on macos 13.6.6 with latest docker desktop in macbook air m1.

Activity

  1. TimSpence commented on Oct 23, 2024

    @TimSpence

    @Glifaus My containers are showing a healthy status. Maybe there was an error in the documentation at that time and it has since been fixed?

    If the issue persists, look at output of docker inspect docker-php-sample-db-1 for the health check logs. There may be some useful information under State --> Health --> Log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions