This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 8a0bf24357c SOLR-16752: Reduce attack surface and size for Docker 
image (#1575)
8a0bf24357c is described below

commit 8a0bf24357ce3f083e9fdf4c66ae7ebf08beacee
Author: Bui Quang Cuong <[email protected]>
AuthorDate: Wed Apr 19 17:14:45 2023 +0200

    SOLR-16752: Reduce attack surface and size for Docker image (#1575)
---
 solr/CHANGES.txt                                          | 2 ++
 solr/docker/templates/Dockerfile.body.template            | 2 +-
 solr/docker/templates/Dockerfile.official.header.template | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e335a8983b0..d3a39f5067a 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -94,6 +94,8 @@ Improvements
 * SOLR-16391: Solr's v2 "create collection" API has been tweaked slightly to 
be more intuitive.  It remains available under
   `POST /api/collections`, but the top level "create" command-name key has 
been removed. (Jason Gerlowski)
 
+* SOLR-16752: Docker: Leave out optional apt packages, slightly reducing image 
size and lowering attack surface (Quang-Cuong Bui)
+
 Optimizations
 ---------------------
 
diff --git a/solr/docker/templates/Dockerfile.body.template 
b/solr/docker/templates/Dockerfile.body.template
index ea627e2a6c5..7282642a73f 100644
--- a/solr/docker/templates/Dockerfile.body.template
+++ b/solr/docker/templates/Dockerfile.body.template
@@ -70,7 +70,7 @@ RUN set -ex; \
 
 RUN set -ex; \
     apt-get update; \
-    apt-get -y install acl lsof procps wget netcat gosu tini jattach; \
+    apt-get -y --no-install-recommends install acl lsof procps wget netcat 
gosu tini jattach; \
     rm -rf /var/lib/apt/lists/*;
 
 VOLUME /var/solr
diff --git a/solr/docker/templates/Dockerfile.official.header.template 
b/solr/docker/templates/Dockerfile.official.header.template
index 96bf2e51edd..3a69f3e756d 100644
--- a/solr/docker/templates/Dockerfile.official.header.template
+++ b/solr/docker/templates/Dockerfile.official.header.template
@@ -45,7 +45,7 @@ ARG 
SOLR_ARCHIVE_URL="https://archive.apache.org/dist/solr/solr/$SOLR_VERSION/so
 
 RUN set -ex; \
   apt-get update; \
-  apt-get -y install wget gpg dirmngr; \
+  apt-get -y --no-install-recommends install wget gpg gnupg dirmngr; \
   rm -rf /var/lib/apt/lists/*; \
   export GNUPGHOME="/tmp/gnupg_home"; \
   mkdir -p "$GNUPGHOME"; \

Reply via email to