Sprkl Docs
SupportSprkl websiteJoin Sprkl betaJoin Sprkl for CI
0.0.66
0.0.66
  • What is Sprkl?
  • Getting started
    • Install Sprkl
    • Instrument your code
      • Bare metal
      • Docker
      • Kubernetes
    • Start with a sample project with Docker Compose
  • Features
    • Instrumentation
      • Frontend tracing - NEW!
      • Selenium tracing - NEW!
    • Dashboard
      • Personal vs. Global
      • Code Block Reference
    • Code markups
    • System Graph
    • Jaeger tracing
    • Jest integration
    • Detect runtime security vulnerabilities in your code
  • Integrations and supported stack
  • Concepts
    • Analysis
  • FAQ
  • Support
  • Sprkl for GitHub Actions
    • Overview
    • Setup
    • Pulling Sprkl data to your IDE for further debugging
  • Troubleshooting
Powered by GitBook
On this page
  1. Getting started
  2. Instrument your code

Docker

PreviousBare metalNextKubernetes

Last updated 2 years ago

Before you begin, you need to make a code change!

Instrumenting containerized executions

When running the Sprkl CLI with Docker (either docker compose , docker-compose or docker run), Sprkl will attach a volume and configure the environment so that the node runtime inside the docker container will be correctly instrumented.

As usual, Sprkl analyzes the code in the repository under the current working directory. The instrumentation applied is according to the code on your local machine. So once running Sprkl with a docker command, make sure the docker images are built up to date.

Docker

You can run your docker commands with sprkl like so:

# Docker image with default entrypoint
sprkl -- docker run my_image

# Docker image with non-default entrypoint:
sprkl -- docker run my_image node index.js

# Using docker cli arguments
sprkl -- docker run --rm -it my_image node index.js

Sprkl CLI supports the full docker command syntax; you can use it as you would any other docker command.

Docker compose

Sprkl can instrument docker-compose applications by updating the docker-compose.yml file specifications.

# Docker compose
sprkl -- docker compose up

Sprkl transforms the compose file to add environment to the containers and attach sprkl to them with a volume.

If you wish to get the changed compose.yml file, run the following:

sprkl -- docker-compose-transform
Here's why.