Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node: Remove unused openssl headers #15700

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Conversation

nodejs-github-bot
Copy link
Contributor

Copy link

Diff for ad44a40:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 03ac51a..d65aa2e 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -19,7 +19,7 @@ Directory: 18/alpine3.17
 
 Tags: 18-bookworm-slim, 18-slim, 18.18-bookworm-slim, 18.18-slim, 18.18.2-bookworm-slim, 18.18.2-slim, hydrogen-bookworm-slim, hydrogen-slim
 Architectures: amd64, arm32v7, arm64v8, ppc64le, s390x
-GitCommit: bdf5edb771596f7e3998ff318c3098850261b17b
+GitCommit: dbc174542d51f03535f6513391f569e3b93a91dd
 Directory: 18/bookworm-slim
 
 Tags: 18-bullseye, 18.18-bullseye, 18.18.2-bullseye, hydrogen-bullseye
@@ -29,7 +29,7 @@ Directory: 18/bullseye
 
 Tags: 18-bullseye-slim, 18.18-bullseye-slim, 18.18.2-bullseye-slim, hydrogen-bullseye-slim
 Architectures: amd64, arm32v7, arm64v8, ppc64le, s390x
-GitCommit: bdf5edb771596f7e3998ff318c3098850261b17b
+GitCommit: dbc174542d51f03535f6513391f569e3b93a91dd
 Directory: 18/bullseye-slim
 
 Tags: 18-buster, 18.18-buster, 18.18.2-buster, hydrogen-buster
@@ -39,7 +39,7 @@ Directory: 18/buster
 
 Tags: 18-buster-slim, 18.18-buster-slim, 18.18.2-buster-slim, hydrogen-buster-slim
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: bdf5edb771596f7e3998ff318c3098850261b17b
+GitCommit: dbc174542d51f03535f6513391f569e3b93a91dd
 Directory: 18/buster-slim
 
 Tags: 20, 20-bookworm, 20.9, 20.9-bookworm, 20.9.0, 20.9.0-bookworm, iron, iron-bookworm, lts, lts-bookworm, lts-iron
@@ -59,7 +59,7 @@ Directory: 20/alpine3.17
 
 Tags: 20-bookworm-slim, 20-slim, 20.9-bookworm-slim, 20.9-slim, 20.9.0-bookworm-slim, 20.9.0-slim, iron-bookworm-slim, iron-slim, lts-bookworm-slim, lts-slim
 Architectures: amd64, arm32v7, arm64v8, ppc64le, s390x
-GitCommit: 62c2e3cfb17ba8d9167b0daebbff9ea5ecaef6e4
+GitCommit: dbc174542d51f03535f6513391f569e3b93a91dd
 Directory: 20/bookworm-slim
 
 Tags: 20-bullseye, 20.9-bullseye, 20.9.0-bullseye, iron-bullseye, lts-bullseye
@@ -69,7 +69,7 @@ Directory: 20/bullseye
 
 Tags: 20-bullseye-slim, 20.9-bullseye-slim, 20.9.0-bullseye-slim, iron-bullseye-slim, lts-bullseye-slim
 Architectures: amd64, arm32v7, arm64v8, ppc64le, s390x
-GitCommit: 62c2e3cfb17ba8d9167b0daebbff9ea5ecaef6e4
+GitCommit: dbc174542d51f03535f6513391f569e3b93a91dd
 Directory: 20/bullseye-slim
 
 Tags: 20-buster, 20.9-buster, 20.9.0-buster, iron-buster, lts-buster
@@ -79,7 +79,7 @@ Directory: 20/buster
 
 Tags: 20-buster-slim, 20.9-buster-slim, 20.9.0-buster-slim, iron-buster-slim, lts-buster-slim
 Architectures: amd64, arm32v7, arm64v8
-GitCommit: 62c2e3cfb17ba8d9167b0daebbff9ea5ecaef6e4
+GitCommit: dbc174542d51f03535f6513391f569e3b93a91dd
 Directory: 20/buster-slim
 
 Tags: 21, 21-bookworm, 21.1, 21.1-bookworm, 21.1.0, 21.1.0-bookworm, bookworm, current, current-bookworm, latest
diff --git a/node_hydrogen-bullseye-slim/Dockerfile b/node_hydrogen-bullseye-slim/Dockerfile
index e9799b3..1b702ae 100644
--- a/node_hydrogen-bullseye-slim/Dockerfile
+++ b/node_hydrogen-bullseye-slim/Dockerfile
@@ -5,14 +5,14 @@ RUN groupadd --gid 1000 node \
 
 ENV NODE_VERSION 18.18.2
 
-RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
-      amd64) ARCH='x64';; \
-      ppc64el) ARCH='ppc64le';; \
-      s390x) ARCH='s390x';; \
-      arm64) ARCH='arm64';; \
-      armhf) ARCH='armv7l';; \
-      i386) ARCH='x86';; \
+      amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
+      ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
+      s390x) ARCH='s390x' OPENSSL_ARCH='linux*-s390x';; \
+      arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
+      armhf) ARCH='armv7l' OPENSSL_ARCH='linux-armv4';; \
+      i386) ARCH='x86' OPENSSL_ARCH='linux-elf';; \
       *) echo "unsupported architecture"; exit 1 ;; \
     esac \
     && set -ex \
@@ -46,6 +46,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
     && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
     && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
+    # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
+    && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
     && apt-mark auto '.*' > /dev/null \
     && find /usr/local -type f -executable -exec ldd '{}' ';' \
       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
diff --git a/node_hydrogen-buster-slim/Dockerfile b/node_hydrogen-buster-slim/Dockerfile
index 1c7b240..d6a50f1 100644
--- a/node_hydrogen-buster-slim/Dockerfile
+++ b/node_hydrogen-buster-slim/Dockerfile
@@ -5,14 +5,14 @@ RUN groupadd --gid 1000 node \
 
 ENV NODE_VERSION 18.18.2
 
-RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
-      amd64) ARCH='x64';; \
-      ppc64el) ARCH='ppc64le';; \
-      s390x) ARCH='s390x';; \
-      arm64) ARCH='arm64';; \
-      armhf) ARCH='armv7l';; \
-      i386) ARCH='x86';; \
+      amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
+      ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
+      s390x) ARCH='s390x' OPENSSL_ARCH='linux*-s390x';; \
+      arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
+      armhf) ARCH='armv7l' OPENSSL_ARCH='linux-armv4';; \
+      i386) ARCH='x86' OPENSSL_ARCH='linux-elf';; \
       *) echo "unsupported architecture"; exit 1 ;; \
     esac \
     && set -ex \
@@ -46,6 +46,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
     && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
     && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
+    # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
+    && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
     && apt-mark auto '.*' > /dev/null \
     && find /usr/local -type f -executable -exec ldd '{}' ';' \
       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
diff --git a/node_hydrogen-slim/Dockerfile b/node_hydrogen-slim/Dockerfile
index a121e2e..ee583e2 100644
--- a/node_hydrogen-slim/Dockerfile
+++ b/node_hydrogen-slim/Dockerfile
@@ -5,14 +5,14 @@ RUN groupadd --gid 1000 node \
 
 ENV NODE_VERSION 18.18.2
 
-RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
-      amd64) ARCH='x64';; \
-      ppc64el) ARCH='ppc64le';; \
-      s390x) ARCH='s390x';; \
-      arm64) ARCH='arm64';; \
-      armhf) ARCH='armv7l';; \
-      i386) ARCH='x86';; \
+      amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
+      ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
+      s390x) ARCH='s390x' OPENSSL_ARCH='linux*-s390x';; \
+      arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
+      armhf) ARCH='armv7l' OPENSSL_ARCH='linux-armv4';; \
+      i386) ARCH='x86' OPENSSL_ARCH='linux-elf';; \
       *) echo "unsupported architecture"; exit 1 ;; \
     esac \
     && set -ex \
@@ -46,6 +46,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
     && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
     && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
+    # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
+    && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
     && apt-mark auto '.*' > /dev/null \
     && find /usr/local -type f -executable -exec ldd '{}' ';' \
       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
diff --git a/node_lts-bullseye-slim/Dockerfile b/node_lts-bullseye-slim/Dockerfile
index 0780ada..48851a9 100644
--- a/node_lts-bullseye-slim/Dockerfile
+++ b/node_lts-bullseye-slim/Dockerfile
@@ -5,14 +5,14 @@ RUN groupadd --gid 1000 node \
 
 ENV NODE_VERSION 20.9.0
 
-RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
-      amd64) ARCH='x64';; \
-      ppc64el) ARCH='ppc64le';; \
-      s390x) ARCH='s390x';; \
-      arm64) ARCH='arm64';; \
-      armhf) ARCH='armv7l';; \
-      i386) ARCH='x86';; \
+      amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
+      ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
+      s390x) ARCH='s390x' OPENSSL_ARCH='linux*-s390x';; \
+      arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
+      armhf) ARCH='armv7l' OPENSSL_ARCH='linux-armv4';; \
+      i386) ARCH='x86' OPENSSL_ARCH='linux-elf';; \
       *) echo "unsupported architecture"; exit 1 ;; \
     esac \
     && set -ex \
@@ -46,6 +46,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
     && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
     && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
+    # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
+    && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
     && apt-mark auto '.*' > /dev/null \
     && find /usr/local -type f -executable -exec ldd '{}' ';' \
       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
diff --git a/node_lts-buster-slim/Dockerfile b/node_lts-buster-slim/Dockerfile
index e21ea76..4a6ec90 100644
--- a/node_lts-buster-slim/Dockerfile
+++ b/node_lts-buster-slim/Dockerfile
@@ -5,14 +5,14 @@ RUN groupadd --gid 1000 node \
 
 ENV NODE_VERSION 20.9.0
 
-RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
-      amd64) ARCH='x64';; \
-      ppc64el) ARCH='ppc64le';; \
-      s390x) ARCH='s390x';; \
-      arm64) ARCH='arm64';; \
-      armhf) ARCH='armv7l';; \
-      i386) ARCH='x86';; \
+      amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
+      ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
+      s390x) ARCH='s390x' OPENSSL_ARCH='linux*-s390x';; \
+      arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
+      armhf) ARCH='armv7l' OPENSSL_ARCH='linux-armv4';; \
+      i386) ARCH='x86' OPENSSL_ARCH='linux-elf';; \
       *) echo "unsupported architecture"; exit 1 ;; \
     esac \
     && set -ex \
@@ -46,6 +46,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
     && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
     && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
+    # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
+    && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
     && apt-mark auto '.*' > /dev/null \
     && find /usr/local -type f -executable -exec ldd '{}' ';' \
       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
diff --git a/node_lts-slim/Dockerfile b/node_lts-slim/Dockerfile
index 36bf144..e9990a7 100644
--- a/node_lts-slim/Dockerfile
+++ b/node_lts-slim/Dockerfile
@@ -5,14 +5,14 @@ RUN groupadd --gid 1000 node \
 
 ENV NODE_VERSION 20.9.0
 
-RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
-      amd64) ARCH='x64';; \
-      ppc64el) ARCH='ppc64le';; \
-      s390x) ARCH='s390x';; \
-      arm64) ARCH='arm64';; \
-      armhf) ARCH='armv7l';; \
-      i386) ARCH='x86';; \
+      amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
+      ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
+      s390x) ARCH='s390x' OPENSSL_ARCH='linux*-s390x';; \
+      arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
+      armhf) ARCH='armv7l' OPENSSL_ARCH='linux-armv4';; \
+      i386) ARCH='x86' OPENSSL_ARCH='linux-elf';; \
       *) echo "unsupported architecture"; exit 1 ;; \
     esac \
     && set -ex \
@@ -46,6 +46,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
     && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
     && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
+    # Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
+    && find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
     && apt-mark auto '.*' > /dev/null \
     && find /usr/local -type f -executable -exec ldd '{}' ';' \
       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \

Relevant Maintainers:

@yosifkit yosifkit merged commit 9d2f6d6 into docker-library:master Nov 14, 2023
@LaurentGoderre LaurentGoderre deleted the node branch November 14, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants