Skip to content

Commit 4e8028f

Browse files
committed
feat: add musl build to python autoinstrumentation
1 parent c7a96ac commit 4e8028f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

autoinstrumentation/python/Dockerfile

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# - Grant the necessary access to `/autoinstrumentation` directory. `chmod -R go+r /autoinstrumentation`
1010
# - For auto-instrumentation by container injection, the Linux command cp is
1111
# used and must be availabe in the image.
12+
# - Please note that we build twice. First time for environments with libc and second time with musl C implementations
1213
FROM python:3.11 AS build
1314

1415
WORKDIR /operator-build
@@ -17,8 +18,18 @@ ADD requirements.txt .
1718

1819
RUN mkdir workspace && pip install --target workspace -r requirements.txt
1920

21+
FROM python:3.11-alpine AS build-musl
22+
23+
WORKDIR /operator-build
24+
25+
ADD requirements.txt .
26+
27+
RUN apk add --update --no-cache gcc musl-dev linux-headers
28+
RUN mkdir workspace && pip install --target workspace -r requirements.txt
29+
2030
FROM busybox
2131

22-
COPY --from=build /operator-build/workspace /autoinstrumentation
32+
COPY --from=build /operator-build/workspace /autoinstrumentation/linux-x64
33+
COPY --from=build-musl /operator-build/workspace /autoinstrumentation/linux-musl-x64
2334

2435
RUN chmod -R go+r /autoinstrumentation

0 commit comments

Comments
 (0)