-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# To build one auto-instrumentation image for Python, please: | ||
# - Ensure the packages are installed in the `/autoinstrumentation` directory. This is required as when instrumenting the pod, | ||
# one init container will be created to copy all the content in `/autoinstrumentation` directory to your app's container. Then | ||
# update the `PYTHONPATH` environment variable accordingly. To achieve this, you can mimic the one in `autoinstrumentation/python/Dockerfile` | ||
# by using multi-stage builds. In the first stage, install all the required packages in one custom directory with `pip install --target`. | ||
# Then in the second stage, copy the directory to `/autoinstrumentation`. | ||
# - Ensure you have `opentelemetry-distro` and `opentelemetry-instrumentation` or your customized alternatives installed. | ||
# Those two packages are essential to Python auto-instrumentation. | ||
# - Grant the necessary access to `/autoinstrumentation` directory. `chmod -R go+r /autoinstrumentation` | ||
# - For auto-instrumentation by container injection, the Linux command cp is | ||
# used and must be available in the image. | ||
FROM python:3.10 AS build | ||
|
||
WORKDIR /operator-build | ||
|
||
ADD aws-opentelemetry-distro/ ./aws-opentelemetry-distro/ | ||
|
||
RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro | ||
|
||
FROM busybox | ||
|
||
COPY --from=build /operator-build/workspace /autoinstrumentation | ||
|
||
RUN chmod -R go+r /autoinstrumentation |
This file contains 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