Python Docker Configuration
  • 1 Minute to read
  • Dark
    Light
  • PDF

Python Docker Configuration

  • Dark
    Light
  • PDF

Article Summary

Follow the instructions here on how to add our profiler to your Dockerfile.

Binding the Host Trace directory to the Guest Trace directory

To get Prefix to read the traces from your app in docker, you need to use bind-mounts as mentioned in this article.

Example

If the host OS is Linux and you also have a Linux OS in the container, you need to bind /usr/local/stackify/stackify-python-apm to the same path in the guest OS for Prefix to see the logs.

Fixed Logging Directories for Python traces

Linux: /usr/local/stackify/stackify-python-apm/log

To bind these directories

We use the --mount argument for the docker run command as follows:
docker run -it --rm -p 8000:80 \
--mount type=bind,source="/usr/local/stackify/stackify-python-apm/log",target=/usr/local/stackify/stackify-python-apm/log \
--name python_sample python-apm


Was this article helpful?