I may be attempting something that is rather impossible so if so tell me please and I give up!
What have been trying to accomplish:
- to add
healthcheck
to container that dos not have the the function built-in - to check the status using:
docker inspect --format "{{json .State.Health }}" CONTAINER_NAME | jq
Here are all the outputs and well the error’s I guess:
docker inspect --format "{{json .State.Health }}" pihole | jq
{
"Status": "healthy",
"FailingStreak": 0,
"Log": [
{
"Start": "2024-05-09T18:33:42.432550214+02:00",
"End": "2024-05-09T18:33:42.512794534+02:00",
"ExitCode": 0,
"Output": "0.0.0.0n"
},
{
"Start": "2024-05-09T18:34:12.513811429+02:00",
"End": "2024-05-09T18:34:12.601584189+02:00",
"ExitCode": 0,
"Output": "0.0.0.0n"
},
{
"Start": "2024-05-09T18:34:42.603722857+02:00",
"End": "2024-05-09T18:34:42.67948883+02:00",
"ExitCode": 0,
"Output": "0.0.0.0n"
},
{
"Start": "2024-05-09T18:35:12.680204934+02:00",
"End": "2024-05-09T18:35:12.751328732+02:00",
"ExitCode": 0,
"Output": "0.0.0.0n"
},
{
"Start": "2024-05-09T18:35:42.752812361+02:00",
"End": "2024-05-09T18:35:42.848423963+02:00",
"ExitCode": 0,
"Output": "0.0.0.0n"
}
]
}
docker inspect --format "{{json .State.Health }}" gluetun | jq
{
"Status": "healthy",
"FailingStreak": 0,
"Log": [
{
"Start": "2024-05-09T18:35:50.158405733+02:00",
"End": "2024-05-09T18:35:50.234108609+02:00",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2024-05-09T18:35:55.235912341+02:00",
"End": "2024-05-09T18:35:55.316256685+02:00",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2024-05-09T18:36:00.317899356+02:00",
"End": "2024-05-09T18:36:00.394049229+02:00",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2024-05-09T18:36:05.395000043+02:00",
"End": "2024-05-09T18:36:05.46558119+02:00",
"ExitCode": 0,
"Output": ""
},
{
"Start": "2024-05-09T18:36:10.466276573+02:00",
"End": "2024-05-09T18:36:10.552487085+02:00",
"ExitCode": 0,
"Output": ""
}
]
}
docker inspect --format "{{json .State.Health }}" qbittorrent | jq
{
"Status": "unhealthy",
"FailingStreak": 30,
"Log": [
{
"Start": "2024-05-09T18:28:19.260234237+02:00",
"End": "2024-05-09T18:28:29.322063926+02:00",
"ExitCode": -1,
"Output": "Health check exceeded timeout (10s): % Total % Received % Xferd Average Speed Time Time Time Currentn Dload Upload Total Spent Left Speednr 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0"
},
{
"Start": "2024-05-09T18:29:59.323289401+02:00",
"End": "2024-05-09T18:30:09.364659871+02:00",
"ExitCode": -1,
"Output": "Health check exceeded timeout (10s): % Total % Received % Xferd Average Speed Time Time Time Currentn Dload Upload Total Spent Left Speednr 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0"
},
{
"Start": "2024-05-09T18:31:39.365847905+02:00",
"End": "2024-05-09T18:31:49.419585754+02:00",
"ExitCode": -1,
"Output": "Health check exceeded timeout (10s): % Total % Received % Xferd Average Speed Time Time Time Currentn Dload Upload Total Spent Left Speednr 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0"
},
{
"Start": "2024-05-09T18:33:19.420526376+02:00",
"End": "2024-05-09T18:33:29.465334657+02:00",
"ExitCode": -1,
"Output": "Health check exceeded timeout (10s): % Total % Received % Xferd Average Speed Time Time Time Currentn Dload Upload Total Spent Left Speednr 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0"
},
{
"Start": "2024-05-09T18:34:59.467015831+02:00",
"End": "2024-05-09T18:35:09.531280977+02:00",
"ExitCode": -1,
"Output": "Health check exceeded timeout (10s): % Total % Received % Xferd Average Speed Time Time Time Currentn Dload Upload Total Spent Left Speednr 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0r 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0"
}
]
}
So I have been at this for several days now and still can’t figure it out so here I’m looking to find someone who has the actual knowledge and the necessary know-how. Firstly, I hope to understand if this is even possible and if so, then try to understand how I would have to go about it and archive it. So your input is greatly appreciated.
Some maybe necessary details:
- the traffic of qBittorret is funneled through Gluetun using
network_mode: "container:gluetun"
which is added to the .yml (more details around that further down in this post) - the image of qBittorrent dose not have a built in healthcheck so I added following to my .yml;
healthcheck:
test: ["CMD", "curl", "-f", "http://10.0.0.10:8085"]
interval: 1m30s
timeout: 10s
retries: 3
Without above lines docker ps
dose not record/show any info regarding the status
of the container in question. Now that it dose, it’s always unhealthy
.
What am I missing?
Here is some general info and outputs:
I run a customized command line: docker -v && docker compose version && docker ps -a --format "table {{.Names}}t{{.State}}t{{.Status}}t{{.Networks}}"
Docker version 26.1.1, build 4cf5afa
Docker Compose version v2.27.0
NAMES STATE STATUS NETWORKS
qbittorrent running Up 10 minutes (unhealthy)
gluetun running Up 38 minutes (healthy) gluetun_default
pihole running Up 3 hours (healthy) pi-hole_default
My docker-compose.yml for gluetun
services:
gluetun:
image: qmcgaw/gluetun:latest
container_name: gluetun
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
ports:
- 8888:8888/tcp
- 8085:8085
- 6881:6881
- 6881:6881/udp
volumes:
- ./:/gluetun
environment:
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=LOST_IT
- WIREGUARD_ADDRESSES=SOME_IP_@_THE_MOON/32
- SERVER_CITIES=STAR_CITY
- TZ=MOON/DARKSIDE
- UPDATER_PERIOD=24h
restart: unless-stopped
My docker-compose.yml for qbittorrent
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=MOON/DARKSIDE
- WEBUI_PORT=8085
- TORRENTING_PORT=6881
volumes:
- ./:/config
- /mnt/nas/media:/downloads
healthcheck:
test: ["CMD", "curl", "-f", "http://10.0.0.10:8085"]
interval: 1m30s
timeout: 10s
retries: 3
network_mode: "container:gluetun"
restart: unless-stopped
My docker-compose.yml for pi-hole
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
environment:
TZ: 'MOON/DARKSIDE'
WEBPASSWORD: 'WOULDNT_YOU_LIKE_TO_KNOW'
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
restart: unless-stopped