Skip to content

Commit

Permalink
feat: add musl build to python autoinstrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyamochalov committed Oct 24, 2023
1 parent c7a96ac commit 4e8028f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion autoinstrumentation/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# - 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 availabe in the image.
# - Please note that we build twice. First time for environments with libc and second time with musl C implementations
FROM python:3.11 AS build

WORKDIR /operator-build
Expand All @@ -17,8 +18,18 @@ ADD requirements.txt .

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

FROM python:3.11-alpine AS build-musl

WORKDIR /operator-build

ADD requirements.txt .

RUN apk add --update --no-cache gcc musl-dev linux-headers
RUN mkdir workspace && pip install --target workspace -r requirements.txt

FROM busybox

COPY --from=build /operator-build/workspace /autoinstrumentation
COPY --from=build /operator-build/workspace /autoinstrumentation/linux-x64
COPY --from=build-musl /operator-build/workspace /autoinstrumentation/linux-musl-x64

RUN chmod -R go+r /autoinstrumentation

0 comments on commit 4e8028f

Please sign in to comment.