Skip to content

docker healthcheck of apiserver not working (again) #5867

@scara

Description

@scara

Current Behavior

Health check fails on both dependencytrack/apiserver:4.13.6 and dependencytrack/apiserver:4.13.6-alpine.

Steps to Reproduce

  1. Start the stack including the apiserver with https://github.com/DependencyTrack/dependency-track/blob/master/src/main/docker/docker-compose.yml, adapting it to use any variant of version 4.13.6
  2. Wait 60 seconds

It looks like both the image variants are missing the curl command which is strange if compared to what done for #5549.
The workaround is to change the CMD from:

      test: [ "CMD-SHELL", "curl -f -s --max-time 3 --noproxy '*' -o /dev/null http://127.0.0.1:8080$${CONTEXT}health" ]

to ( dependencytrack/apiserver:4.13.6 ):

      test: [ "CMD-SHELL", "wget --quiet --tries=1 --timeout=3 --no-proxy -O /dev/null http://127.0.0.1:8080$${CONTEXT}health"]

to (dependencytrack/apiserver:4.13.6-alpine):

      test: [ "CMD-SHELL", "wget --quiet --tries=1 --timeout=3 -Y off -O /dev/null http://127.0.0.1:8080$${CONTEXT}health"]

Double checking curlvs wget availability:

$ docker run --rm -it dependencytrack/apiserver:4.13.6-alpine sh -c "command -v curl >/dev/null 2>&1" && echo "curl found" || echo "curl missing"
curl missing
$ docker run --rm -it dependencytrack/apiserver:4.13.6 sh -c "command -v curl >/dev/null 2>&1" && echo "curl found" || echo "curl missing"
curl missing
$ docker run --rm -it dependencytrack/apiserver:4.13.6-alpine sh -c "command -v wget >/dev/null 2>&1" && echo "wget found" || echo "wget missing"
wget found
$ docker run --rm -it dependencytrack/apiserver:4.13.6 sh -c "command -v wget >/dev/null 2>&1" && echo "wget found" || echo "wget missing"
wget found
$ docker run --rm -it dependencytrack/apiserver:4.13.6-alpine ls -l /usr/bin | grep curl
$ docker run --rm -it dependencytrack/apiserver:4.13.6-alpine ls -l /usr/bin | grep wget
lrwxrwxrwx    1 root     root            12 Oct  8 09:28 wget -> /bin/busybox
$ docker run --rm -it dependencytrack/apiserver:4.13.6 ls -l /usr/bin | grep curl
$ docker run --rm -it dependencytrack/apiserver:4.13.6 ls -l /usr/bin | grep wget
-rwxr-xr-x. 1 root root    482672 Mar  8  2025  wget

Expected Behavior

Health check not failing for missing CLI command.

Dependency-Track Version

4.13.6

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

postgres:17.9-alpine

Browser

Google Chrome

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions