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

Health check not compatible with containers that use a non standard host IP binding #1666

Open
cosmikwolf opened this issue Dec 16, 2024 · 0 comments

Comments

@cosmikwolf
Copy link
Contributor

cosmikwolf commented Dec 16, 2024

When I am running blocky, it reports that it is unhealthy, even though it is running correctly:

ubuntu@server /m/d/d/blocky> docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS                     PORTS                                                                                                                 NAMES
9227503fa980   ghcr.io/0xerr0r/blocky:latest   "/app/blocky"            4 minutes ago   Up 4 minutes (unhealthy)   192.168.20.96:53->53/tcp, 192.168.50.47:4000->4000/tcp, 192.168.20.96:53->53/udp                                      blocky

The health check command is failing:

ubuntu@miniserver /m/d/d/blocky> docker compose exec blocky /app/blocky healthcheck
NOT OK
Error: dial tcp 127.0.0.1:53: connect: connection refused

I believe this is because I am using a non standard host binding port in my docker compose file:

My dockerfile:

services:
  blocky:
    image: "ghcr.io/0xerr0r/blocky:latest"
    container_name: blocky
    restart: unless-stopped
    networks:
      - dns
    # Optional the instance hostname for logging purpose
    hostname: "blocky"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "4000:4000/tcp"
    environment:
      - TZ=PST
    volumes:
      # Optional to synchronize the log timestamp with host
      - /etc/localtime:/etc/localtime:ro
      # config file
      - ./config.yml:/app/config.yml

networks:
  dns:
    driver: bridge
    driver_opts:
      com.docker.network.bridge.host_binding_ipv4: "192.168.20.96"

If there was an --ip flag on healthcheck, I would be able to set the bound IP address. Maybe there is already an env variable I am unaware of?

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

1 participant