Skip to content

Tests are not purged successfully during build on alpine #98

@ushuz

Description

@ushuz

It seems that find -exec rm -rf '{}' + command that is used to purge tests and *.py[co] (https://github.com/docker-library/python/blob/master/2.7/alpine/Dockerfile#L46-L49) didn't achieve its goal. The tests are still in the image, and contribute 16~20M image size.

You can check it out by running

$ docker run --rm python:2-alpine find /usr/local \( -type d -a -name test -o -name tests \) -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \)
/usr/local/lib/python2.7/lib2to3/tests
/usr/local/lib/python2.7/ctypes/test
/usr/local/lib/python2.7/json/tests
/usr/local/lib/python2.7/sqlite3/test
/usr/local/lib/python2.7/lib-tk/test
/usr/local/lib/python2.7/unittest/test
/usr/local/lib/python2.7/distutils/tests
/usr/local/lib/python2.7/test
/usr/local/lib/python2.7/site-packages/wheel/test
/usr/local/lib/python2.7/email/test
/usr/local/lib/python2.7/bsddb/test
$ docker run --rm python:alpine find /usr/local \( -type d -a -name test -o -name tests \) -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \)
/usr/local/lib/python3.5/lib2to3/tests
/usr/local/lib/python3.5/ctypes/test
/usr/local/lib/python3.5/sqlite3/test
/usr/local/lib/python3.5/unittest/test
/usr/local/lib/python3.5/distutils/tests
/usr/local/lib/python3.5/test
/usr/local/lib/python3.5/tkinter/test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy