Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16752: Reduce attack surface and size for Docker image (#1575)

Bui Quang Cuong8a0bf24357ce
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"; \