dhi.io/dependencytrack-apiserver
OWASP Dependency-Track API server identifies risk in the software supply chain from a component inventory.
All examples in this guide use the public image. If you've mirrored the repository for your own use (for example, to your Docker Hub namespace), update your commands to reference the mirrored image instead of the public one.
For example:
dhi.io/<repository>:<tag><your-namespace>/dhi-<repository>:<tag>For the examples, you must first use docker login dhi.io to authenticate to the registry to pull the images.
This image is the OWASP Dependency-Track API server. It replaces dependencytrack/apiserver. The frontend is a separate
upstream image and is out of scope. Project documentation is at https://dependencytrack.org/.
Tag 4 is the 4.x line. It listens on port 8080 and uses an embedded H2 database. Tag 5 is the 5.x line. It listens
on port 8080 for the API and port 9000 for management, and it requires PostgreSQL 14 or newer. Both lines are published
for Debian 13 and Alpine 3.24. Debian floating tags are 4 and 5. Alpine 3.24 tags use the alpine3.24 suffix, for
example 4-alpine3.24 and 5-alpine3.24.
The runtime process runs as uid 1000. Its working directory is /opt/owasp/dependency-track/ (a symlink to the
installed server files). HOME and the dtrack passwd home are both /data/. Java uses that passwd home as
user.home. The server creates /data/.dependency-track on startup. Mount a volume on /data.
/data is mode 0775, owned by uid 1000 and gid 1000. Only that user, or a process in group 1000, can write it. An
arbitrary uid in group 0 cannot. Upstream images use uid 1000 and gid 0. A bind-mounted host directory must be writable
by uid 1000 or gid 1000.
Version 4 starts with its embedded H2 database. No separate database container is required. The H2 file is
/data/.dependency-track/db.mv.db.
$ docker run -d --name dependencytrack-apiserver \
-p 8080:8080 \
-v dependencytrack-data:/data \
dhi.io/dependencytrack-apiserver:4
This image has no OCI health check. The runtime image has no curl binary, so probe the published port from the host:
$ curl -fsS http://127.0.0.1:8080/health/ready
A ready server returns JSON whose status field is UP. GET /health/live and GET /health/started on port 8080 also
return "status":"UP". The version endpoint returns JSON whose version field matches the image's version tag:
$ curl -fsS http://127.0.0.1:8080/api/version
Version 4 sets LOGGING_LEVEL to INFO and LOGGING_CONFIG_PATH to logback.xml. The default start does not need a
logback.xml file.
Version 5 exits with status 1 when no datasource is configured. The log contains SRCFG00040 and
dt.datasource.default.url. Use PostgreSQL 14 or newer. Save the following as compose.yml. The database user,
password, and database name must match the API server settings.
services:
dependencytrack-apiserver:
image: dhi.io/dependencytrack-apiserver:5
container_name: dependencytrack-apiserver
ports:
- "8080:8080"
- "9000:9000"
environment:
DT_DATASOURCE_URL: jdbc:postgresql://postgres:5432/dtrack
DT_DATASOURCE_USERNAME: dtrack
DT_DATASOURCE_PASSWORD: dtrack
volumes:
- dependencytrack-data:/data
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: dtrack
POSTGRES_PASSWORD: dtrack
POSTGRES_DB: dtrack
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dtrack -d dtrack"]
interval: 5s
timeout: 5s
retries: 12
volumes:
dependencytrack-data:
postgres-data:
FIPS tags need DT_DATASOURCE_PASSWORD and POSTGRES_PASSWORD of at least 14 characters. dtrack in the example above
is for non-FIPS tags. On a FIPS tag, set a longer password on both services.
$ docker compose up -d
Management health is GET http://127.0.0.1:9000/health/ready. It can return "status":"UP" before the API is ready.
Wait until GET http://127.0.0.1:8080/api/version succeeds before you call the API. The version field matches the
image's version tag.
$ curl -fsS http://127.0.0.1:9000/health/ready
$ curl -fsS http://127.0.0.1:8080/api/version
Version 5 keeps keys and storage under /data/.dependency-track.
Both lines disable Base64 intrinsics with -XX:-UseBASE64Intrinsics, preserving the upstream security workaround. Line
5 additionally sets -XX:+ExitOnOutOfMemoryError, matching its upstream launch defaults.
Both lines set JAVA_OPTIONS to G1GC with string deduplication, compact object headers, MaxGCPauseMillis=250, and
MaxRAMPercentage=80.0. FIPS tags also set javax.net.ssl.trustStore to the BCFKS truststore,
javax.net.ssl.trustStoreType=BCFKS, and javax.net.ssl.trustStorePassword=changeit. Pass more JVM flags with
EXTRA_JAVA_OPTIONS. That variable defaults to an empty string; pass -e EXTRA_JAVA_OPTIONS=... to add flags. The
startup command expands it. If you replace JAVA_OPTIONS, keep the truststore flags on FIPS tags.
$ docker run -d --name dependencytrack-apiserver \
-p 8080:8080 \
-e EXTRA_JAVA_OPTIONS=-Xmx512m \
-v dependencytrack-data:/data \
dhi.io/dependencytrack-apiserver:4
These variables are set on the runtime image:
| Variable | Description | Default |
|---|---|---|
HOME | Home directory, matching the dtrack passwd home. The server writes /data/.dependency-track. | /data/ |
JAVA_HOME | Temurin 25 JRE. java is on PATH at /usr/bin/java. Symlink to /usr/lib/jvm/temurin-25. | /opt/java/openjdk |
LANG | Locale on runtime tags. Dev tags set en_US.UTF-8. | C.UTF-8 |
TZ | Time zone. | Etc/UTC |
DT_DATASOURCE_URL, DT_DATASOURCE_USERNAME, and DT_DATASOURCE_PASSWORD are not set in the image. Version 5 requires
them, as in the Compose example above.
curl and no package manager. Alpine runtime images include gcompat so the server's glibc
JNI libraries can load. Upstream health checks run curl (4.x) or wget (5.x) inside the container. Probe HTTP from
the host, as shown above./etc/passwd contains dtrack:x:1000:1000:dtrack user:/data/:/bin/sh. Upstream sets the login shell to /bin/false.
This image uses /bin/sh because /bin/false is not installed. On Debian, /bin/sh is dash. On Alpine, /bin/sh is
busybox. It is not a general-purpose shell and it does not provide curl or a package manager.5-fips, 5-alpine3.24-fips, and the matching dev tags) add the Temurin FIPS JRE and the OpenSSL FIPS
provider. The FIPS runtime environment includes OPENSSL_CONF, OPENSSL_MODULES, and SSL_CERT_FILE, and
JAVA_OPTIONS adds the BCFKS truststore flags described above. A 5.x FIPS datasource password must be at least 14
characters.Mount extra JARs, such as JDBC drivers, into /opt/owasp/dependency-track/lib-external. The directory is root-owned and
included in the server classpath; the runtime user cannot modify application code.
4.x runtime and dev tags remain available. The four 4.x FIPS tags are withheld because the 4.x embedded server ignores
BCFIPS on its -jar launch, and its key manager hardcodes SHA1PRNG, which approved-only BCFIPS refuses. Use 5.x for
FIPS. Reintroducing 4.x FIPS requires an approved-RNG package fix, provider-aware launch, key creation and successful
login.
Docker Hardened Images come in different variants depending on their intended use. Image variants are identified by their tag.
Runtime variants are designed to run your application in production. These images are intended to be used either directly or as the FROM image in the final stage of a multi-stage build. These images typically:
Build-time variants typically include dev in the tag name and are intended for use in the first stage of a
multi-stage Dockerfile. These images typically:
FIPS variants include fips in the variant name and tag. They come in both runtime and build-time variants. These
variants use cryptographic modules that have been validated under FIPS 140, a U.S. government standard for secure
cryptographic operations. For example, usage of MD5 fails in FIPS variants.
To view the image variants and get more information about them, select the Tags tab for this repository, and then select a tag.
To migrate your application to a Docker Hardened Image, you must update your Dockerfile. At minimum, you must update the base image in your existing Dockerfile to a Docker Hardened Image. This and a few other common changes are listed in the following table of migration notes.
| Item | Migration note |
|---|---|
| Base image | Replace your base images in your Dockerfile with a Docker Hardened Image. |
| Package management | Non-dev images, intended for runtime, don't contain package managers. Use package managers only in images with a dev tag. |
| Non-root user | By default, non-dev images, intended for runtime, run as the nonroot user. Ensure that necessary files and directories are accessible to the nonroot user. |
| Multi-stage build | Utilize images with a dev tag for build stages and non-dev images for runtime. For binary executables, use a static image for runtime. |
| TLS certificates | Docker Hardened Images contain standard TLS certificates by default. There is no need to install TLS certificates. |
| Ports | Non-dev hardened images run as a nonroot user by default. As a result, applications in these images can't bind to privileged ports (below 1024) when running in Kubernetes or in Docker Engine versions older than 20.10. To avoid issues, configure your application to listen on port 1025 or higher inside the container. |
| Entry point | Docker Hardened Images may have different entry points than images such as Docker Official Images. Inspect entry points for Docker Hardened Images and update your Dockerfile if necessary. |
| No shell | By default, non-dev images, intended for runtime, don't contain a shell. Use dev images in build stages to run shell commands and then copy artifacts to the runtime stage. |
The following steps outline the general migration process.
Find hardened images for your app.
A hardened image may have several variants. Inspect the image tags and find the image variant that meets your needs.
Update the base image in your Dockerfile.
Update the base image in your application's Dockerfile to the hardened image you found in the previous step. For
framework images, this is typically going to be an image tagged as dev because it has the tools needed to install
packages and dependencies.
For multi-stage Dockerfiles, update the runtime image in your Dockerfile.
To ensure that your final image is as minimal as possible, you should use a multi-stage build. All stages in your
Dockerfile should use a hardened image. While intermediary stages will typically use images tagged as dev, your
final runtime stage should use a non-dev image variant.
Install additional packages
Docker Hardened Images contain minimal packages in order to reduce the potential attack surface. You may need to install additional packages in your Dockerfile. Inspect the image variants to identify which packages are already installed.
Only images tagged as dev typically have package managers. You should use a multi-stage Dockerfile to install the
packages. Install the packages in the build stage that uses a dev image. Then, if needed, copy any necessary
artifacts to the runtime stage that uses a non-dev image.
For Alpine-based images, you can use apk to install packages. For Debian-based images, you can use apt-get to
install packages.
The following are common issues that you may encounter during migration.
The hardened images intended for runtime don't contain a shell nor any tools for debugging. The recommended method for debugging applications built with Docker Hardened Images is to use Docker Debug to attach to these containers. Docker Debug provides a shell, common debugging tools, and lets you install other tools in an ephemeral, writable layer that only exists during the debugging session.
By default image variants intended for runtime, run as the nonroot user. Ensure that necessary files and directories are accessible to the nonroot user. You may need to copy files to different directories or change permissions so your application running as the nonroot user can access them.
Non-dev hardened images run as a nonroot user by default. As a result, applications in these images can't bind to
privileged ports (below 1024) when running in Kubernetes or in Docker Engine versions older than 20.10. To avoid issues,
configure your application to listen on port 1025 or higher inside the container, even if you map it to a lower port on
the host. For example, docker run -p 80:8080 my-image will work because the port inside the container is 8080, and
docker run -p 80:81 my-image won't work because the port inside the container is 81.
By default, image variants intended for runtime don't contain a shell. Use dev images in build stages to run shell
commands and then copy any necessary artifacts into the runtime stage. In addition, use Docker Debug to debug containers
with no shell.
Docker Hardened Images may have different entry points than images such as Docker Official Images. Use docker inspect
to inspect entry points for Docker Hardened Images and update your Dockerfile if necessary.