slimtoolkit / slimtoolkit/slim

Missing files

Open
#163 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.4k
Forks
841
PR merge metrics
No merged PRs in 30d

Description

I have a legacy python app which uses celery==3.1.26.post2 and the official image python:2.7.18-slim-buster.

When I run docker-slim --http-probe=false my/image it goes from ~180MB to ~49MB, that's cool. But there are some celery files missing, in my case /usr/local/lib/python2.7/site-packages/celery/worker/strategy.py. The app code is copied to /app/tasks.

Then I tried building an image using python:3.8.5-slim-buster. This time the code at /app/tasks is missing and /usr/local/lib/python3.8/site-packages/celery/worker (the whole directory) too. I guess this scenario fails because the app doesn't work on Python 3 due to import failures in the dependencies, but the missing app code really caught my eye, or maybe I missed something?

The Dockerfile goes like this:

ARG PYTHON_VERSION=2.7.18

FROM python:${PYTHON_VERSION}-slim-buster AS base
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

FROM base AS release
COPY tasks tasks
USER nobody
ENV PYTHONWARNINGS=ignore
ENV PYTHONUNBUFFERED=1
ENTRYPOINT ["celery", "worker", "--app=tasks", "--pool=eventlet"]
CMD ["--loglevel=INFO", "--concurrency=100"]

requirements.txt:

requests[security]==2.19.1
soundcloud==0.5.0
celery==3.1.26.post2
kombu==3.0.37
eventlet==0.24.1
python-json-logger==0.1.11
sentry-sdk==0.16.3
six==1.15.0

Version:

$ ./docker-slim --version
docker-slim version linux|Transformer|1.32.0|10b628fc3cd9f903237b9c31a6aba5ac4e6bc9c8|2020-08-24_06:14:32AM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported docker-slim 1.32.0 command and the supplied Dockerfile and requirements.txt. Reproduce the image-minification run for the Python 2.7 and 3.8 variants, then inspect whether /app/tasks and the reported celery paths are retained. Done means the cause of the missing files is identified and the affected paths are handled consistently or the behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile, python
Domain
devops, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.