Add locust-otel Docker image with OpenTelemetry dependencies#3379
Merged
cyberw merged 4 commits intolocustio:masterfrom Mar 22, 2026
Merged
Add locust-otel Docker image with OpenTelemetry dependencies#3379cyberw merged 4 commits intolocustio:masterfrom
cyberw merged 4 commits intolocustio:masterfrom
Conversation
Add Dockerfile.otel based on Dockerfile.ci that installs locust[otel] extras. Add CI jobs to test and publish the image to the locustio/locust-otel Docker Hub repository. Fixes locustio#3309
cyberw
reviewed
Mar 21, 2026
docs/running-in-docker.rst
Outdated
Collaborator
|
Niiice! Would it be possible to chain the build to reduce duplication? So the other file becomes just something like this (not tested) FROM locustio/locust |
Reduce duplication by building Dockerfile.otel on top of the base locust image instead of repeating all build steps from Dockerfile.ci. The OTEL image now uses a build arg (BASE_IMAGE) so CI can point it at the locally built or just-published base image. The publish job depends on publish-docker to guarantee the base image exists.
The Buildx builder runs inside an isolated BuildKit container that cannot see images loaded into the host Docker daemon via load: true. Use plain docker build for the OTel image so it can resolve the locally-built base image directly.
The dedicated locustio/locust-otel image covers this now.
Contributor
Author
|
@cyberw The Dockerfile already chains from the base image. It does FROM ${BASE_IMAGE} and installs the wheel with [otel] extras on top. The COPY ./dist is needed because the wheel isn't on PyPI at build time. Fixed the CI failure and removed the otel line from the base image example. The otel build was using Buildx, which runs in an isolated BuildKit container that can't see images loaded into the host Docker daemon via load: true. Switched to plain docker build for that step. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The official Docker image does not include the OpenTelemetry exporter libraries, so running with
--otelfails with an import error.Added a
Dockerfile.otelthat installs the[otel]extras and publishes a separatelocustio/locust-otelimage. A CI test job verifies the OTel packages import correctly before publish.Fixes #3309