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

Docker/Podman healthcheck doesn't work with signal and relay containers #2930

Open
mradermaxlol opened this issue Nov 22, 2024 · 0 comments
Open

Comments

@mradermaxlol
Copy link

mradermaxlol commented Nov 22, 2024

Describe the problem

Docker/Podman healthcheck fails for signal & relay containers as, apparently, there is no /bin/sh in their base (distroless) image:
Error: crun: executable file /bin/sh not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
Healthcheck works fine for e.g. management container (as it's Ubuntu-based).

AFAIK the healthcheck mechanism doesn't allow specifying a binary path directly (and so /bin/sh invocation can't be bypassed).

I'm using the following healthcheck snippets for signal & relay, respectively:

healthcheck:
  start_period: 5s
  timeout: 3s
  interval: 15s
  retries: 2
  test: "ps aux | grep -v grep | grep -q netbird-signal || exit 1"
healthcheck:
  start_period: 5s
  timeout: 3s
  interval: 15s
  retries: 2
  test: "ps aux | grep -v grep | grep -q netbird-relay || exit 1"

As a suggestion on how to make it work - perhaps it's worth creating symlink to the actual shell in the containers' Dockerfiles? One extra line sounds reasonable.

To Reproduce

Steps to reproduce the behavior:

  1. Add the aforementioned healthcheck snippets to the compose file (for signal & relay containers)
  2. Start the compose project
  3. Experience healthcheck errors in system logs
  4. Also experience wrong container health status

Expected behavior
Healthcheck works for singal & relay containers.

Are you using NetBird Cloud?
No.

NetBird version
0.32.0

NetBird status -dA output:
N/A

Do you face any (non-mobile) client issues?
N/A

Screenshots
N/A

Additional context
N/A

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

No branches or pull requests

1 participant