Healthcheck fails
mapshen opened this issue · 3 comments
ARG
variables are only available at build time, which means PORT
[1] will be undefined in the resulting image, which can confirmed with docker inspect
:
"Healthcheck": {
"Test": [
"CMD-SHELL",
"curl -s http://127.0.0.1:$PORT -o /dev/null || exit 1"
],
"Interval": 5000000000,
"Timeout": 3000000000,
"StartPeriod": 5000000000
},
The above healthcheck would fail and cause running containers to appear "unhealthy".
On the other hand, ENV
values are always persisted in the built image, so I would recommend we use the ENV
instruction to set the port and rename PORT
to LISTEN_PORT
, so that it can be overridden correctly at run time.
[1] https://github.com/vladvasiliu/kibana-prometheus-exporter-py/blob/master/Dockerfile#L8
Thanks for signaling this. The issue has been solved in v1.14.1 (a4bb6a6)
@vladvasiliu is it possible for us to consolidate PORT
and LISTEN_PORT
? Currently, if I were to use a custom port, I would have to configure both.
I've fixed that.