pip multi-stage to detect errors
This commit is contained in:
parent
64aa99f791
commit
70436142a0
10
Dockerfile
10
Dockerfile
|
|
@ -37,11 +37,11 @@ WORKDIR /app
|
||||||
|
|
||||||
# Install Python packages
|
# Install Python packages
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir --upgrade pip && \
|
RUN pip install --no-cache-dir --upgrade pip
|
||||||
pip install --no-cache-dir --prefix=/install -r requirements.txt && \
|
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
|
||||||
# Clean up unnecessary files to reduce image size
|
# Clean up unnecessary files to reduce image size (failures here are non-fatal)
|
||||||
find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
|
RUN find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
|
||||||
find /install -type f -name "*.pyc" -delete && \
|
find /install -type f -name "*.pyc" -delete 2>/dev/null || true && \
|
||||||
find /install -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true && \
|
find /install -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true && \
|
||||||
find /install -type d -name "*.dist-info" -exec rm -rf {}/RECORD {} + 2>/dev/null || true
|
find /install -type d -name "*.dist-info" -exec rm -rf {}/RECORD {} + 2>/dev/null || true
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue