Skip to content

Commit 71849fa

Browse files
committed
chore: try to keep dynamically linked files
1 parent eb89a38 commit 71849fa

File tree

8 files changed

+112
-0
lines changed

8 files changed

+112
-0
lines changed

10/buster-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

10/jessie-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

10/stretch-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

12/buster-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

12/stretch-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

13/buster-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

13/stretch-slim/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
4242
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
4343
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
4444
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { print $(NF-1) }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
4552
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
4653
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
4754
# smoke tests
@@ -69,6 +76,13 @@ RUN set -ex \
6976
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
7077
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
7178
&& apt-mark auto '.*' > /dev/null \
79+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
7286
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
7387
# smoke test
7488
&& yarn --version

Dockerfile-slim.template

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
3232
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
3333
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
3434
&& apt-mark auto '.*' > /dev/null \
35+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
36+
| awk '/=>/ { print $(NF-1) }' \
37+
| sort -u \
38+
| xargs -r dpkg-query --search \
39+
| cut -d: -f1 \
40+
| sort -u \
41+
| xargs -r apt-mark manual \
3542
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
3643
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
3744
# smoke tests
@@ -59,6 +66,13 @@ RUN set -ex \
5966
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
6067
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
6168
&& apt-mark auto '.*' > /dev/null \
69+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
70+
| awk '/=>/ { print $(NF-1) }' \
71+
| sort -u \
72+
| xargs -r dpkg-query --search \
73+
| cut -d: -f1 \
74+
| sort -u \
75+
| xargs -r apt-mark manual \
6276
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
6377
# smoke test
6478
&& yarn --version

0 commit comments

Comments
 (0)