Skip to content

Commit

Permalink
fix: change tests to use slim instead of alpine because of C extensio…
Browse files Browse the repository at this point in the history
…ns to pydantic
  • Loading branch information
tedostrem committed Nov 6, 2024
1 parent 5341dd3 commit 1fa9883
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Builder stage
FROM --platform=$BUILDPLATFORM python:3.11-alpine AS builder
FROM --platform=$BUILDPLATFORM python:3.11-slim AS builder

WORKDIR /build

# Install build dependencies
RUN apk add --no-cache gcc musl-dev python3-dev linux-headers
RUN apt-get update && apt-get install -y \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY tests/python/requirements.txt .
Expand All @@ -13,13 +16,10 @@ COPY tests/python/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt --target /install

# Final stage
FROM --platform=$TARGETPLATFORM python:3.11-alpine
FROM --platform=$TARGETPLATFORM python:3.11-slim

WORKDIR /tests

# Install runtime dependencies
RUN apk add --no-cache libstdc++

# Copy only the installed packages and test files
COPY --from=builder /install /usr/local/lib/python3.11/site-packages/
COPY tests/python .
Expand Down

0 comments on commit 1fa9883

Please sign in to comment.