Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] No way to implement docker-compose health-check #1895

Open
aokhonchenko opened this issue Aug 6, 2024 · 1 comment
Open

[Bug] No way to implement docker-compose health-check #1895

aokhonchenko opened this issue Aug 6, 2024 · 1 comment

Comments

@aokhonchenko
Copy link

I am trying to do simple thing - check readiness probe with docker-compose.

tag - 5.15.0


  mockserver:
    image: mockserver/mockserver:5.15.0
    ports:
      - "17777:1080"
    environment:
      MOCKSERVER_PORT_NUMBER: 1080
      MOCKSERVER_LIVENESS_HTTP_GET_PATH: "/liveness/probe"
      MOCKSERVER_INITIALIZATION_JSON_PATH: "/stubs/*.json"
      MOCKSERVER_WATCH_INITIALIZATION_JSON: true
      MOCKSERVER_LOG_LEVEL: DEBUG
    healthcheck:
#      test: curl --fail http://localhost:1080/liveness/probe || exit 1
      test: wget --no-verbose --tries=1 --spider http://localhost:1080/liveness/probe || exit 1
      interval: 60s
      retries: 5
      start_period: 5s
      timeout: 10s
    volumes:
      - type: bind
        source: ./src/test/resources/stubs
        target: /stubs
        read_only: true

After about 60s server fails.

@aokhonchenko aokhonchenko changed the title No way to implement docker-compose health-check [Bug] No way to implement docker-compose health-check Aug 6, 2024
@kasir-barati
Copy link

Any update? or if it is not possible please let us know by adding a section in docker hub so people know that it does not have something like that.

I also tried to exec inside it and check what is available but it seems this image has a very fundamental issue. $PATH is unknown. In other word curl, wget or any kind of command in general cannot be used. Try to exec into it like this:

docker exec -it container_id /bin/sh
# or
docker exec -it container_id /bin/bash
# or
docker exec -it container_id bash

So I guess the problem lies in $PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants