sentryEstimated reading time: 6 minutes
Sentry is a realtime, platform-agnostic error logging and aggregation platform
GitHub repo: https://github.com/getsentry/docker-sentry
Supported tags and respective
Where to file issues:
Supported Docker versions:
the latest release (down to 1.6 on a best-effort basis)
What is Sentry?
Sentry is a realtime event logging and aggregation platform. It specializes in monitoring errors and extracting all the information needed to do a proper post-mortem without any of the hassle of the standard user feedback loop.
How to use this image
How to setup a full Sentry instance
Start a Redis container
$ docker run -d --name sentry-redis redis
Start a Postgres container
$ docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres
Generate a new secret key to be shared by all
sentrycontainers. This value will then be used as the
$ docker run --rm sentry config generate-secret-key
If this is a new database, you’ll need to run
$ docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade
-itis important as the initial upgrade will prompt to create an initial user and will fail without it
Now start up Sentry server
$ docker run -d --name my-sentry -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry
The default config needs a celery beat and celery workers, start as many workers as you need (each with a unique name)
$ docker run -d --name sentry-cron -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry run cron $ docker run -d --name sentry-worker-1 -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry run worker
If you’d like to be able to access the instance from the host without the container’s IP, standard port mappings can be used. Just add
-p 8080:9000 to the
docker run arguments and then access either
http://host-ip:8080 in a browser.
Configuring the initial user
If you did not create a superuser during
upgrade, use the following to create one:
$ docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry createuser
When you start the
sentry image, you can adjust the configuration of the Sentry instance by passing one or more environment variables on the
docker run command line. Please note that these environment variables are provided as a jump start, and it’s highly recommended to either mount in your own config file or utilize the
A secret key used for cryptographic functions within Sentry. This key should be unique and consistent across all running instances. You can generate a new secret key doing something like:
$ docker run --rm sentry config generate-secret-key
Database credentials for your Postgres server. These values aren’t needed if a linked
postgres container exists.
Connection information for your Redis server. These values aren’t needed if a linked
redis container exists.
Connection information for a Memcache server. These values aren’t needed if a linked
memcached container exists.
Directory where uploaded files will be stored. This defaults to
/var/lib/sentry/files and is a
VOLUME for persistent data.
The email address used for
From: in outbound emails. Default:
Connection information for an outbound smtp server. These values aren’t needed if a linked
smtp container exists.
If you’re using Mailgun for inbound mail, set your API key and configure a route to forward to
sentry images come in many flavors, each designed for a specific use case.
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
This image makes it easy to custom build your own Sentry instance by copying in a custom
sentry.conf.py file and installing plugins from
It’s also possible to develop custom extensions within your
onbuild package. If the build directory contains a
setup.py file, this will also get installed.
See the official Sentry documentation for more information.
To create your custom
sentry:onbuild package, simply do the following:
- Create a Dockerfile containing
- In the same directory, add your custom configuration files.
- You can get copies of those files to use as templates from the docker-sentry GitHub repo.
- Build your image:
docker build -t mysentry .
- Run your custom image using
View license information for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in the
As for any pre-built image usage, it is the image user’s responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.library, sample, sentry