I am trying to upload a Python .whl file (essentially a .zip file) while building a Dockerfile image:

FROM python:3.12-slim-bookworm
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install unzip
ADD download/pypackage.whl /tmp/pypackage.whl
RUN unzip -t /tmp/pypackage.whl

The docker build fails with this:

error [/tmp/pypackage.whl]: missing 13 bytes in zipfile

But if I run unzip -t on the local version of the file I get no error:

$ unzip -t download/pypackage.whl
No errors detected in compressed data of download/pypackage.whl.

How do I fix this?

  • I tested out your Dockerfile with a different .whl file and got no error. Did you try with any other file??
    – Ajay
    Commented Apr 11 at 4:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.