Skip to content

Commit f83ecbf

Browse files
authored
Merge pull request #483 from autoferrit/master
add LDFLAGS for optimizing image size
2 parents f4eaaa9 + 6a981eb commit f83ecbf

File tree

18 files changed

+18
-0
lines changed

18 files changed

+18
-0
lines changed

3.5/alpine3.10/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ RUN set -ex \
7878
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7979
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8080
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
81+
LDFLAGS="-Wl,--strip-all" \
8182
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8283
PROFILE_TASK='-m test.regrtest --pgo \
8384
test_array \

3.5/alpine3.11/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ RUN set -ex \
7878
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7979
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8080
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
81+
LDFLAGS="-Wl,--strip-all" \
8182
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8283
PROFILE_TASK='-m test.regrtest --pgo \
8384
test_array \

3.5/buster/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN set -ex \
7070
--with-system-ffi \
7171
--without-ensurepip \
7272
&& make -j "$(nproc)" \
73+
LDFLAGS="-Wl,--strip-all" \
7374
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7475
PROFILE_TASK='-m test.regrtest --pgo \
7576
test_array \

3.5/stretch/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN set -ex \
7070
--with-system-ffi \
7171
--without-ensurepip \
7272
&& make -j "$(nproc)" \
73+
LDFLAGS="-Wl,--strip-all" \
7374
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7475
PROFILE_TASK='-m test.regrtest --pgo \
7576
test_array \

3.6/alpine3.10/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ RUN set -ex \
8080
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8181
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8282
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
83+
LDFLAGS="-Wl,--strip-all" \
8384
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8485
PROFILE_TASK='-m test.regrtest --pgo \
8586
test_array \

3.6/alpine3.11/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ RUN set -ex \
8080
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8181
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8282
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
83+
LDFLAGS="-Wl,--strip-all" \
8384
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8485
PROFILE_TASK='-m test.regrtest --pgo \
8586
test_array \

3.6/buster/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN set -ex \
7070
--with-system-ffi \
7171
--without-ensurepip \
7272
&& make -j "$(nproc)" \
73+
LDFLAGS="-Wl,--strip-all" \
7374
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7475
PROFILE_TASK='-m test.regrtest --pgo \
7576
test_array \

3.6/stretch/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ RUN set -ex \
7070
--with-system-ffi \
7171
--without-ensurepip \
7272
&& make -j "$(nproc)" \
73+
LDFLAGS="-Wl,--strip-all" \
7374
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7475
PROFILE_TASK='-m test.regrtest --pgo \
7576
test_array \

3.7/alpine3.10/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ RUN set -ex \
8181
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8282
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8383
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
84+
LDFLAGS="-Wl,--strip-all" \
8485
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8586
PROFILE_TASK='-m test.regrtest --pgo \
8687
test_array \

3.7/alpine3.11/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ RUN set -ex \
8181
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8282
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8383
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
84+
LDFLAGS="-Wl,--strip-all" \
8485
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
8586
PROFILE_TASK='-m test.regrtest --pgo \
8687
test_array \

3.7/buster/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ RUN set -ex \
7171
--with-system-ffi \
7272
--without-ensurepip \
7373
&& make -j "$(nproc)" \
74+
LDFLAGS="-Wl,--strip-all" \
7475
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7576
PROFILE_TASK='-m test.regrtest --pgo \
7677
test_array \

3.7/stretch/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ RUN set -ex \
7171
--with-system-ffi \
7272
--without-ensurepip \
7373
&& make -j "$(nproc)" \
74+
LDFLAGS="-Wl,--strip-all" \
7475
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7576
PROFILE_TASK='-m test.regrtest --pgo \
7677
test_array \

3.8/alpine3.10/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ RUN set -ex \
8181
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8282
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8383
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
84+
LDFLAGS="-Wl,--strip-all" \
8485
&& make install \
8586
\
8687
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \

3.8/alpine3.11/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ RUN set -ex \
8181
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8282
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8383
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
84+
LDFLAGS="-Wl,--strip-all" \
8485
&& make install \
8586
\
8687
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \

3.8/buster/slim/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ RUN set -ex \
7171
--with-system-ffi \
7272
--without-ensurepip \
7373
&& make -j "$(nproc)" \
74+
LDFLAGS="-Wl,--strip-all" \
7475
&& make install \
7576
&& ldconfig \
7677
\

3.9-rc/alpine3.11/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ RUN set -ex \
8181
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
8282
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8383
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
84+
LDFLAGS="-Wl,--strip-all" \
8485
&& make install \
8586
\
8687
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \

Dockerfile-alpine.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ RUN set -ex \
7575
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
7676
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
7777
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
78+
LDFLAGS="-Wl,--strip-all" \
7879
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
7980
PROFILE_TASK='-m test.regrtest --pgo \
8081
test_array \

Dockerfile-slim.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ RUN set -ex \
6565
--with-system-ffi \
6666
--without-ensurepip \
6767
&& make -j "$(nproc)" \
68+
LDFLAGS="-Wl,--strip-all" \
6869
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
6970
PROFILE_TASK='-m test.regrtest --pgo \
7071
test_array \

0 commit comments

Comments
 (0)