added strip -s to nginx image to reduce image size
All checks were successful
CI / Build nginx docker images (push) Successful in 15m46s

This commit is contained in:
2025-10-31 17:30:34 +08:00
parent d40f99c2ac
commit 89fd216f14
2 changed files with 3 additions and 4 deletions

View File

@@ -12,7 +12,6 @@ RUN --mount=type=cache,target=/var/cache/apk apk add \
build-base \
ca-certificates \
cmake \
curl \
gcc \
gd-dev \
geoip-dev \

View File

@@ -7,8 +7,8 @@ mkdir -p /usr/share/nginx/html/
install -m644 docs/html/index.html /usr/share/nginx/html/
install -m644 docs/html/50x.html /usr/share/nginx/html/
ln -s ../../usr/lib/nginx/modules /etc/nginx/modules
strip /usr/sbin/nginx*
strip /usr/lib/nginx/modules/*.so
strip -s /usr/sbin/nginx*
strip -s /usr/lib/nginx/modules/*.so
# Bring in gettext so we can get `envsubst`, then throw
# the rest away. To do this, we need to install `gettext`
@@ -24,4 +24,4 @@ mv /tmp/envsubst /usr/local/bin/
# forward request and error logs to docker log collect
mkdir -p /var/log/nginx
ln -sf /dev/stdout /var/log/nginx/access.log
ln -sf /dev/stderr /var/log/nginx/error.log
ln -sf /dev/stderr /var/log/nginx/error.log