mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
Strip debugging information to reduce file sizes
This commit is contained in:
@@ -209,6 +209,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -226,7 +252,7 @@ FROM devilbox/php-fpm:5.2-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -209,6 +209,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -226,7 +252,7 @@ FROM devilbox/php-fpm:5.3-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -209,6 +209,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -226,7 +252,7 @@ FROM devilbox/php-fpm:5.4-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -209,6 +209,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -226,7 +252,7 @@ FROM devilbox/php-fpm:5.5-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -213,6 +213,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -230,7 +256,7 @@ FROM devilbox/php-fpm:5.6-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -213,6 +213,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -230,7 +256,7 @@ FROM devilbox/php-fpm:7.0-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:7.1-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:7.2-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:7.3-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:7.4-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:8.0-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:8.1-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
@@ -207,6 +207,32 @@ RUN set -eux \
|
||||
cp -r /usr/bin/mongo* /tmp/mongo/; \
|
||||
fi
|
||||
|
||||
###
|
||||
### Strip debugging information to smallen filesize
|
||||
###
|
||||
RUN set -eux \
|
||||
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
|
||||
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
|
||||
\
|
||||
&& for bin in ${STRIP_USR_BINS}; do \
|
||||
( \
|
||||
find /usr/bin/ -name "${bin}"* -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& for dir in ${STRIP_DIRS}; do \
|
||||
( \
|
||||
find ${dir} -type f -print0 \
|
||||
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
|
||||
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
|
||||
) \
|
||||
done \
|
||||
\
|
||||
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
|
||||
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
@@ -224,7 +250,7 @@ FROM devilbox/php-fpm:8.2-prod as devilbox-slim-base
|
||||
ARG ARCH
|
||||
|
||||
###
|
||||
### Copy shared libraries
|
||||
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
|
||||
###
|
||||
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
|
||||
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
|
||||
|
||||
Reference in New Issue
Block a user