Marc Funaro
10/21/2022, 3:36 PMMarc Funaro
10/21/2022, 4:02 PMfalse
, but added it as true
directly to the Dockerfile and have observed the "warmup" notice during the build, with no shutdown happening during running of the container. But i'm not sure if it's doing what it should, as the first request still takes some time to get a response. If this is the workflow (build: warmup=true, run: warmup=false), then I guess I just need some sort of way to confirm that it's actually working.Patrick
10/21/2022, 4:09 PMPatrick
10/21/2022, 4:11 PMMarc Funaro
10/21/2022, 4:14 PMPatrick
10/21/2022, 4:18 PMPatrick
10/21/2022, 4:18 PMMarc Funaro
10/21/2022, 4:18 PMPatrick
10/21/2022, 4:19 PMPatrick
10/21/2022, 4:19 PMMarc Funaro
10/21/2022, 4:21 PMPatrick
10/21/2022, 4:27 PMMarc Funaro
10/21/2022, 4:29 PMPatrick
10/21/2022, 4:42 PMMarc Funaro
10/21/2022, 4:43 PMPatrick
10/21/2022, 4:44 PMbdw429s
10/21/2022, 6:00 PMbdw429s
10/21/2022, 6:01 PMbdw429s
10/21/2022, 6:01 PMbdw429s
10/21/2022, 6:02 PMMarc Funaro
10/21/2022, 6:02 PMbdw429s
10/21/2022, 6:02 PMbdw429s
10/21/2022, 6:03 PMMarc Funaro
10/21/2022, 6:04 PMbdw429s
10/21/2022, 6:05 PMbdw429s
10/21/2022, 6:05 PMbdw429s
10/21/2022, 6:06 PMis it definite that the container won't be fully accessible until the healthcheck (1) executes at least once, and (2) returns a 200 status,Out of the box, the healthcheck command in our images is just a basic curl to
/
that needs to get a successful return. You can still configure that further if you like such as
⢠the URL to his
⢠the timeout before trying againMarc Funaro
10/21/2022, 6:07 PMbdw429s
10/21/2022, 6:08 PMMarc Funaro
10/21/2022, 6:08 PMMarc Funaro
10/21/2022, 6:08 PMbdw429s
10/21/2022, 6:09 PMPatrick
10/21/2022, 6:09 PMbdw429s
10/21/2022, 6:10 PMMarc Funaro
10/21/2022, 6:13 PMMarc Funaro
10/21/2022, 6:13 PMbdw429s
10/21/2022, 6:15 PMbdw429s
10/21/2022, 6:15 PMbdw429s
10/21/2022, 6:16 PMMarc Funaro
10/21/2022, 6:16 PMbdw429s
10/21/2022, 6:16 PMbdw429s
10/21/2022, 6:17 PMMarc Funaro
10/21/2022, 6:20 PMbdw429s
10/21/2022, 6:22 PM--fail
handles thatPatrick
10/21/2022, 6:23 PMMarc Funaro
10/21/2022, 6:24 PMPatrick
10/21/2022, 6:36 PMHEALTHCHECK --interval=2s --timeout=5m --start-period=3s CMD bash healthcheck.sh
Patrick
10/21/2022, 6:36 PMPatrick
10/21/2022, 6:36 PM#!/bin/sh
code=$(curl -o /dev/null -s -w "%{http_code}\n" <http://localhost/ping>)
echo "response code: $code"
if [ "$code" == "200" ]
then
echo "success"
exit 0;
else
echo "error"
exit 1;
fi
Marc Funaro
10/21/2022, 6:41 PMbdw429s
10/21/2022, 6:42 PM--fail
flag doesbdw429s
10/21/2022, 6:42 PMPatrick
10/21/2022, 6:44 PMPatrick
10/21/2022, 6:44 PMMarc Funaro
10/21/2022, 6:47 PM-f, --fail
is used.bdw429s
10/21/2022, 6:48 PMcurl is saying anything other than 0 is a failThat's not really a curl standard. Every shell across all operating systems treat exit codes like that
bdw429s
10/21/2022, 6:48 PMPatrick
10/21/2022, 6:49 PMbdw429s
10/21/2022, 6:52 PMthe operation went as planned.I think it's safe to say a 200 status code is "as planned", but what about a 203 (Non-Authoritative)? A 302 or a 301? They're sort of vague about that
Patrick
10/21/2022, 6:53 PMbdw429s
10/21/2022, 6:54 PMPatrick
10/21/2022, 6:54 PMbdw429s
10/21/2022, 6:55 PMbdw429s
10/21/2022, 6:55 PMbdw429s
10/21/2022, 7:03 PMcurl
, it seems that curl always returns a failing exit code if it thinks the request failed. All the --fail
flag appears to do is tells it to fail silently and not go spitting out to the console.