[ 
https://issues.apache.org/jira/browse/NIFI-5955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anthony Mastrean updated NIFI-5955:
-----------------------------------
    Description: 
It takes Nifi a noticeable amount of time to become available at 
[http://localhost:8080/nifi.] We can help indicate readiness to both human and 
machine users (see 
[depends_on|https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on]
 in Compose) by establishing a HEALTHCHECK in the Dockerfile.

The 
[documentation|https://docs.docker.com/engine/reference/builder/#healthcheck] 
suggests
{code:java}
HEALTHCHECK CMD curl -f http://localhost:8080/nifi || exit 1{code}
 

But, there are [better cURL 
flags|https://explainshell.com/explain?cmd=curl+-fsSL+example.org] for scripts.
{code:java}
HEALTHCHECK CMD curl -fsSL http://localhost:8080/nifi || exit 1
{code}
 

And I sometimes see problems using {{localhost}} (possibly a Docker networking 
issue?). I've seen this pattern suggested elsewhere. 
{code:java}
HEALTHCHECK CMD curl -fsSL http://$(hostname -i || echo localhost):8080/nifi || 
exit 1
{code}
 

  was:
It takes Nifi a noticeable amount of time to become available at 
[http://localhost:8080/nifi.] We can help indicate readiness to both human and 
machine users (see 
[depends_on|https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on]
 in Compose) by establishing a HEALTHCHECK in the Dockerfile.

The 
[documentation|https://docs.docker.com/engine/reference/builder/#healthcheck] 
suggests

 

{{HEALTHCHECK CMD curl -f http://localhost:8080/nifi || exit 1}}

 

But, there are [better cURL 
flags|https://explainshell.com/explain?cmd=curl+-fsSL+example.org] for scripts.

 
{code:java}
HEALTHCHECK CMD curl -fsSL http://localhost:8080/nifi || exit 1
{code}
And I sometimes see problems using {{localhost}} (possibly a Docker networking 
issue?). I've seen this pattern suggested elsewhere.

 
{code:java}
HEALTHCHECK CMD curl -fsSL http://$(hostname -i || echo localhost):8080/nifi || 
exit 1
{code}
 


> Provide a Docker HEALTHCHECK
> ----------------------------
>
>                 Key: NIFI-5955
>                 URL: https://issues.apache.org/jira/browse/NIFI-5955
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Docker
>            Reporter: Anthony Mastrean
>            Priority: Minor
>
> It takes Nifi a noticeable amount of time to become available at 
> [http://localhost:8080/nifi.] We can help indicate readiness to both human 
> and machine users (see 
> [depends_on|https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on]
>  in Compose) by establishing a HEALTHCHECK in the Dockerfile.
> The 
> [documentation|https://docs.docker.com/engine/reference/builder/#healthcheck] 
> suggests
> {code:java}
> HEALTHCHECK CMD curl -f http://localhost:8080/nifi || exit 1{code}
>  
> But, there are [better cURL 
> flags|https://explainshell.com/explain?cmd=curl+-fsSL+example.org] for 
> scripts.
> {code:java}
> HEALTHCHECK CMD curl -fsSL http://localhost:8080/nifi || exit 1
> {code}
>  
> And I sometimes see problems using {{localhost}} (possibly a Docker 
> networking issue?). I've seen this pattern suggested elsewhere. 
> {code:java}
> HEALTHCHECK CMD curl -fsSL http://$(hostname -i || echo localhost):8080/nifi 
> || exit 1
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to