Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding a healthcheck to a docker image?

Featured Replies

I have a docker image (qbittorrent) with a vpn built in that I use. It works great, EXCEPT that every couple of days, the vpn dies. The WebUI still works fine, but you can't curl to any address from the command line, and i get a notice from some sites that i'm no longer seeding.

 

I did some digging on this and found a thing people can add to their docker image called a healthcheck? Sorry if this is obvious, i'm very new to docker and unraid.

 

Basically you'd add something like:

    healthcheck:
      test: ["CMD-SHELL", "curl -f http://google.com || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 5

 

I have no idea how to add that to a docker image i got from the community. Plus, if I add it, will it get wiped out the next time I go into the docker settings and re-apply?

 

Searching here and elsewhere hasn't provided much help. Is this an option for me?

I would suggest posting this question in the support thread for the docker in question.

  • 2 weeks later...
  • Author

They said in "Extra Params or something like that" you can just "drop in all the docker CLI stuff"

 

which is helpful if you know exactly what that means.

I'm unclear what the docker command line stuff would be, but I believe they're referring to the Extra Parameters section.

 

This section (for this container) already has a few parameters there, in the format:

--param=VALUE --secondparam=SECOND_VALUE

 

I have no idea what precisely to put here to add a healthcheck.

  • 5 months later...

In extra parameters.

 

--health-cmd='curl -fSs http://google.com > /dev/null || exit 1' --health-interval=10s --health-retries=3 --health-timeout=5s --health-start-period=20s

 

You can then run another container called autoheal, which will restart any unhealthy containers.

 

Enjoy.

Edited by petersem

  • 1 year later...
On 4/17/2024 at 4:23 AM, theothermatt_b said:

They said in "Extra Params or something like that" you can just "drop in all the docker CLI stuff"

 

which is helpful if you know exactly what that means.

I'm unclear what the docker command line stuff would be, but I believe they're referring to the Extra Parameters section.

 

This section (for this container) already has a few parameters there, in the format:

--param=VALUE --secondparam=SECOND_VALUE

 

I have no idea what precisely to put here to add a healthcheck.

Sorry to revive an old thread, but just in case anyone else comes across this topic (as I'm was also trying to work this out today in UNRAID > Docker area).

Provided you already have docker enabled and some docker containers installed, go to Docker tab (top menu bar of UNRAID) > click on the name of the docker container you want to add a health check parameter for > this should open the containers config settings > in the top right hand corner (along the 'update container' heading) click the 'Basic View' toggle to switch to 'Advanced View' > You will now see additional fields, one of which is 'Extra Parameters:'). Put your health check command and it's parameters in there.

I am a noob in this topic, but I found out that not every docker container has curl, like some alpine based containers.
I replaced the extra parm command to use wget for these containers:
--health-cmd="wget --no-verbose --tries=1 --spider http://1.1.1.1 || exit 1" --health-interval=100s --health-retries=3 --health-timeout=30s --health-start-period=60s

I also replaced google with 1.1.1.1 so it's not affected by a dns problem

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.