Skip to content

Commit 5d71a7c

Browse files
authored
Merge pull request #508 from infosiftr/no-a-files
Adjust installation order and purge "libpythonXX.a" files
2 parents dcf0dd4 + 7a3801a commit 5d71a7c

File tree

29 files changed

+206
-188
lines changed

29 files changed

+206
-188
lines changed

3.5/alpine3.11/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ RUN set -ex \
116116
test_unicode \
117117
' \
118118
&& make install \
119+
&& rm -rf /usr/src/python \
120+
\
121+
&& find /usr/local -depth \
122+
\( \
123+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
124+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
125+
-o \( -type f -a -name 'wininst-*.exe' \) \
126+
\) -exec rm -rf '{}' + \
119127
\
120128
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
121129
| tr ',' '\n' \
@@ -124,14 +132,6 @@ RUN set -ex \
124132
| xargs -rt apk add --no-cache --virtual .python-rundeps \
125133
&& apk del --no-network .build-deps \
126134
\
127-
&& find /usr/local -depth \
128-
\( \
129-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
130-
-o \
131-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
132-
\) -exec rm -rf '{}' + \
133-
&& rm -rf /usr/src/python \
134-
\
135135
&& python3 --version
136136

137137
# make some useful symlinks that are expected to exist

3.5/alpine3.12/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ RUN set -ex \
116116
test_unicode \
117117
' \
118118
&& make install \
119+
&& rm -rf /usr/src/python \
120+
\
121+
&& find /usr/local -depth \
122+
\( \
123+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
124+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
125+
-o \( -type f -a -name 'wininst-*.exe' \) \
126+
\) -exec rm -rf '{}' + \
119127
\
120128
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
121129
| tr ',' '\n' \
@@ -124,14 +132,6 @@ RUN set -ex \
124132
| xargs -rt apk add --no-cache --virtual .python-rundeps \
125133
&& apk del --no-network .build-deps \
126134
\
127-
&& find /usr/local -depth \
128-
\( \
129-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
130-
-o \
131-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
132-
\) -exec rm -rf '{}' + \
133-
&& rm -rf /usr/src/python \
134-
\
135135
&& python3 --version
136136

137137
# make some useful symlinks that are expected to exist

3.5/buster/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ RUN set -ex \
8484
test_unicode \
8585
' \
8686
&& make install \
87-
&& ldconfig \
87+
&& rm -rf /usr/src/python \
8888
\
8989
&& find /usr/local -depth \
9090
\( \
9191
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
92-
-o \
93-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
92+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
93+
-o \( -type f -a -name 'wininst-*.exe' \) \
9494
\) -exec rm -rf '{}' + \
95-
&& rm -rf /usr/src/python \
95+
\
96+
&& ldconfig \
9697
\
9798
&& python3 --version
9899

3.5/buster/slim/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ RUN set -ex \
108108
test_unicode \
109109
' \
110110
&& make install \
111+
&& rm -rf /usr/src/python \
112+
\
113+
&& find /usr/local -depth \
114+
\( \
115+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
116+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
117+
-o \( -type f -a -name 'wininst-*.exe' \) \
118+
\) -exec rm -rf '{}' + \
119+
\
111120
&& ldconfig \
112121
\
113122
&& apt-mark auto '.*' > /dev/null \
@@ -122,14 +131,6 @@ RUN set -ex \
122131
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
123132
&& rm -rf /var/lib/apt/lists/* \
124133
\
125-
&& find /usr/local -depth \
126-
\( \
127-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
128-
-o \
129-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
130-
\) -exec rm -rf '{}' + \
131-
&& rm -rf /usr/src/python \
132-
\
133134
&& python3 --version
134135

135136
# make some useful symlinks that are expected to exist

3.5/stretch/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ RUN set -ex \
8484
test_unicode \
8585
' \
8686
&& make install \
87-
&& ldconfig \
87+
&& rm -rf /usr/src/python \
8888
\
8989
&& find /usr/local -depth \
9090
\( \
9191
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
92-
-o \
93-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
92+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
93+
-o \( -type f -a -name 'wininst-*.exe' \) \
9494
\) -exec rm -rf '{}' + \
95-
&& rm -rf /usr/src/python \
95+
\
96+
&& ldconfig \
9697
\
9798
&& python3 --version
9899

3.5/stretch/slim/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ RUN set -ex \
108108
test_unicode \
109109
' \
110110
&& make install \
111+
&& rm -rf /usr/src/python \
112+
\
113+
&& find /usr/local -depth \
114+
\( \
115+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
116+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
117+
-o \( -type f -a -name 'wininst-*.exe' \) \
118+
\) -exec rm -rf '{}' + \
119+
\
111120
&& ldconfig \
112121
\
113122
&& apt-mark auto '.*' > /dev/null \
@@ -122,14 +131,6 @@ RUN set -ex \
122131
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
123132
&& rm -rf /var/lib/apt/lists/* \
124133
\
125-
&& find /usr/local -depth \
126-
\( \
127-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
128-
-o \
129-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
130-
\) -exec rm -rf '{}' + \
131-
&& rm -rf /usr/src/python \
132-
\
133134
&& python3 --version
134135

135136
# make some useful symlinks that are expected to exist

3.6/alpine3.11/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ RUN set -ex \
118118
test_unicode \
119119
' \
120120
&& make install \
121+
&& rm -rf /usr/src/python \
122+
\
123+
&& find /usr/local -depth \
124+
\( \
125+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
126+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
127+
-o \( -type f -a -name 'wininst-*.exe' \) \
128+
\) -exec rm -rf '{}' + \
121129
\
122130
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
123131
| tr ',' '\n' \
@@ -126,14 +134,6 @@ RUN set -ex \
126134
| xargs -rt apk add --no-cache --virtual .python-rundeps \
127135
&& apk del --no-network .build-deps \
128136
\
129-
&& find /usr/local -depth \
130-
\( \
131-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
132-
-o \
133-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
134-
\) -exec rm -rf '{}' + \
135-
&& rm -rf /usr/src/python \
136-
\
137137
&& python3 --version
138138

139139
# make some useful symlinks that are expected to exist

3.6/alpine3.12/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ RUN set -ex \
118118
test_unicode \
119119
' \
120120
&& make install \
121+
&& rm -rf /usr/src/python \
122+
\
123+
&& find /usr/local -depth \
124+
\( \
125+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
126+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
127+
-o \( -type f -a -name 'wininst-*.exe' \) \
128+
\) -exec rm -rf '{}' + \
121129
\
122130
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
123131
| tr ',' '\n' \
@@ -126,14 +134,6 @@ RUN set -ex \
126134
| xargs -rt apk add --no-cache --virtual .python-rundeps \
127135
&& apk del --no-network .build-deps \
128136
\
129-
&& find /usr/local -depth \
130-
\( \
131-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
132-
-o \
133-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
134-
\) -exec rm -rf '{}' + \
135-
&& rm -rf /usr/src/python \
136-
\
137137
&& python3 --version
138138

139139
# make some useful symlinks that are expected to exist

3.6/buster/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ RUN set -ex \
8484
test_unicode \
8585
' \
8686
&& make install \
87-
&& ldconfig \
87+
&& rm -rf /usr/src/python \
8888
\
8989
&& find /usr/local -depth \
9090
\( \
9191
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
92-
-o \
93-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
92+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
93+
-o \( -type f -a -name 'wininst-*.exe' \) \
9494
\) -exec rm -rf '{}' + \
95-
&& rm -rf /usr/src/python \
95+
\
96+
&& ldconfig \
9697
\
9798
&& python3 --version
9899

3.6/buster/slim/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ RUN set -ex \
108108
test_unicode \
109109
' \
110110
&& make install \
111+
&& rm -rf /usr/src/python \
112+
\
113+
&& find /usr/local -depth \
114+
\( \
115+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
116+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
117+
-o \( -type f -a -name 'wininst-*.exe' \) \
118+
\) -exec rm -rf '{}' + \
119+
\
111120
&& ldconfig \
112121
\
113122
&& apt-mark auto '.*' > /dev/null \
@@ -122,14 +131,6 @@ RUN set -ex \
122131
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
123132
&& rm -rf /var/lib/apt/lists/* \
124133
\
125-
&& find /usr/local -depth \
126-
\( \
127-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
128-
-o \
129-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
130-
\) -exec rm -rf '{}' + \
131-
&& rm -rf /usr/src/python \
132-
\
133134
&& python3 --version
134135

135136
# make some useful symlinks that are expected to exist

3.6/stretch/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ RUN set -ex \
8484
test_unicode \
8585
' \
8686
&& make install \
87-
&& ldconfig \
87+
&& rm -rf /usr/src/python \
8888
\
8989
&& find /usr/local -depth \
9090
\( \
9191
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
92-
-o \
93-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
92+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
93+
-o \( -type f -a -name 'wininst-*.exe' \) \
9494
\) -exec rm -rf '{}' + \
95-
&& rm -rf /usr/src/python \
95+
\
96+
&& ldconfig \
9697
\
9798
&& python3 --version
9899

3.6/stretch/slim/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ RUN set -ex \
108108
test_unicode \
109109
' \
110110
&& make install \
111+
&& rm -rf /usr/src/python \
112+
\
113+
&& find /usr/local -depth \
114+
\( \
115+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
116+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
117+
-o \( -type f -a -name 'wininst-*.exe' \) \
118+
\) -exec rm -rf '{}' + \
119+
\
111120
&& ldconfig \
112121
\
113122
&& apt-mark auto '.*' > /dev/null \
@@ -122,14 +131,6 @@ RUN set -ex \
122131
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
123132
&& rm -rf /var/lib/apt/lists/* \
124133
\
125-
&& find /usr/local -depth \
126-
\( \
127-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
128-
-o \
129-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
130-
\) -exec rm -rf '{}' + \
131-
&& rm -rf /usr/src/python \
132-
\
133134
&& python3 --version
134135

135136
# make some useful symlinks that are expected to exist

3.7/alpine3.11/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ RUN set -ex \
119119
test_unicode \
120120
' \
121121
&& make install \
122+
&& rm -rf /usr/src/python \
123+
\
124+
&& find /usr/local -depth \
125+
\( \
126+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
127+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
128+
-o \( -type f -a -name 'wininst-*.exe' \) \
129+
\) -exec rm -rf '{}' + \
122130
\
123131
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
124132
| tr ',' '\n' \
@@ -127,14 +135,6 @@ RUN set -ex \
127135
| xargs -rt apk add --no-cache --virtual .python-rundeps \
128136
&& apk del --no-network .build-deps \
129137
\
130-
&& find /usr/local -depth \
131-
\( \
132-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
133-
-o \
134-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
135-
\) -exec rm -rf '{}' + \
136-
&& rm -rf /usr/src/python \
137-
\
138138
&& python3 --version
139139

140140
# make some useful symlinks that are expected to exist

3.7/alpine3.12/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ RUN set -ex \
119119
test_unicode \
120120
' \
121121
&& make install \
122+
&& rm -rf /usr/src/python \
123+
\
124+
&& find /usr/local -depth \
125+
\( \
126+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
127+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
128+
-o \( -type f -a -name 'wininst-*.exe' \) \
129+
\) -exec rm -rf '{}' + \
122130
\
123131
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
124132
| tr ',' '\n' \
@@ -127,14 +135,6 @@ RUN set -ex \
127135
| xargs -rt apk add --no-cache --virtual .python-rundeps \
128136
&& apk del --no-network .build-deps \
129137
\
130-
&& find /usr/local -depth \
131-
\( \
132-
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
133-
-o \
134-
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
135-
\) -exec rm -rf '{}' + \
136-
&& rm -rf /usr/src/python \
137-
\
138138
&& python3 --version
139139

140140
# make some useful symlinks that are expected to exist

0 commit comments

Comments
 (0)