GHOSTby AlphaBravo
CatalogWhy GhostContactAccount
Ghost Container Registry — Secure, signed, FIPS-ready images·Built by AlphaBravo
Catalog/snyk/Guides

snyk cli

Developer tools

Find and fix vulnerabilities in code, dependencies, containers, and infrastructure as code

OverviewGuidesTags

Quick Start

Pull the latest version of this image from the Ghost registry. Pulling requires authentication — generate a token and run docker login first (see Authentication below).

Authentication

The Ghost catalog is public to browse, but pulling images requires an account. Generate a pull token below (or from your Account → Tokens page) — you'll get a ready-to-paste docker login command, then docker pull works.

The username is generated automatically (it looks like robot$<project>+<auto-id>, not the name you typed) and is included in the docker login command above. The secret is shown only once when you create the token.

Verify Signature

All Ghost images are signed with cosign. Verifying the signature before deployment ensures the image has not been tampered with.

Install cosign via brew install cosign or download from the Sigstore releases page.

Using This Image

Reference this image in your Dockerfile as a base layer:

Additional Notes

How to use this image

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:

  • Public image: registry.ghost-prod.alphabravo.io/ghost-base/<repository>:<tag>
  • Mirrored image: <your-namespace>/dhi-<repository>:<tag>

For the examples, you must first use docker login registry.ghost-prod.alphabravo.io to authenticate to the registry to pull the images.

Most Snyk commands require authentication. Provide an API token through the SNYK_TOKEN environment variable when running the container.

Start a Snyk DHI container

Replace <tag> with the image variant you want to run.

# Check the Snyk CLI version
$ docker run --rm registry.ghost-prod.alphabravo.io/ghost-base/snyk:<tag> --version

Common Snyk DHI use cases

Test a project for vulnerabilities

On this page

Quick StartAuthenticationVerify SignatureUsing This ImageAdditional Notes

Mount your project and pass your API token:

$ docker run --rm -e SNYK_TOKEN -v "$PWD:/project" -w /project registry.ghost-prod.alphabravo.io/ghost-base/snyk:<tag> test

Scan a container image

$ docker run --rm -e SNYK_TOKEN registry.ghost-prod.alphabravo.io/ghost-base/snyk:<tag> container test alpine:3.20

Run the Model Context Protocol (MCP) server

The Snyk CLI ships an MCP server in the same binary. Start it over stdio so an AI assistant can call Snyk scans as tools:

$ docker run --rm -i -e SNYK_TOKEN registry.ghost-prod.alphabravo.io/ghost-base/snyk:<tag> mcp -t stdio

Use in a CI pipeline (multi-stage Dockerfile)

# syntax=docker/dockerfile:1
FROM registry.ghost-prod.alphabravo.io/ghost-base/snyk:<tag> AS scan
ARG SNYK_TOKEN
COPY . /project
WORKDIR /project
RUN snyk test --severity-threshold=high

Non-hardened images vs Ghost hardened images

FeatureStandard Snyk imagesDocker Hardened Snyk
SecurityStandard base with common utilitiesHardened base with reduced utilities
Package managerFull package managers (apk, apt)System package managers removed
UserRuns as rootRuns as nonroot user
Attack surfaceFull system utilities availableSignificantly reduced

Image variants

Runtime variants are designed to run Snyk commands in production and CI. These images typically:

  • Run as the nonroot user
  • Contain only the Snyk CLI and essential dependencies (ca-certificates)
  • Require docker debug for any debugging needs

Dev variants include -dev in the variant name and tag. They are build-time images intended for multi-stage Dockerfiles. These variants:

  • Run as root user
  • Include a shell and system package manager
  • Include standard development packages (bash, ca-certificates, coreutils, findutils)
  • Should not be used in production

Migrate to a Ghost hardened image

To migrate from the official snyk/snyk images to Ghost hardened images, update your deployment configuration and potentially your Dockerfile.

ItemMigration note
Base imageReplace snyk/snyk images with Docker Hardened Snyk images
EntrypointThe entrypoint is snyk; pass subcommands such as test or mcp directly
Package managementSystem package managers removed in runtime variants
Non-root userRuntime images run as the nonroot user
AuthenticationProvide SNYK_TOKEN as an environment variable rather than baking in config

Troubleshooting migration

Authentication

Most Snyk commands require an authenticated session. Pass -e SNYK_TOKEN to the container, or run snyk auth from a dev variant to populate the configuration mounted at the user's home directory.

Permissions

By default, runtime image variants run as the nonroot user. Snyk writes its cache and configuration under the home directory (/home/nonroot). Ensure any mounted project files are accessible to the nonroot user.

Privileged 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.