Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.85 KB

docker-container.md

File metadata and controls

69 lines (45 loc) · 1.85 KB

Docker Container

datadog-static-analyzer is available for use in a Docker container. The container is published to the GHCR registry.

Requirements

  • Docker
  • An x86_64 or arm64 machine

Setup

First, pull the container image:

docker pull ghcr.io/datadog/datadog-static-analyzer:latest

Then, run the container to verify that it works:

docker run ghcr.io/datadog/datadog-static-analyzer:latest --help

Usage

The container can be run in the same way as the binary. For example, to run the analyzer on a directory stored at $PATH_TO_ANALYZE:

docker run -v $PATH_TO_ANALYZE:/data ghcr.io/datadog/datadog-static-analyzer:latest -i /data -o /data/output.sarif -b -f sarif

Using datadog-ci

The datadog-ci tool is also available in the container, and can be used to upload your results to the Datadog app. To use it, run the container with the datadog-ci command by overriding the entrypoint:

docker run --entrypoint datadog-ci ghcr.io/datadog/datadog-static-analyzer:latest --help

Building the container from source

To build the container from source, clone the repository and run the following:

docker build -t datadog-static-analyzer .

Then, run the locally-built container:

docker run datadog-static-analyzer --help

Pinning the container

If you are interested in pinning the container to a specific version, each release is tagged with the version name as well. For example, to use version 0.3.5:

docker pull ghcr.io/datadog/datadog-static-analyzer:0.3.5

Issues

If you encounter any issues, please open an issue here.