File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ ARG DP_PHP_DEB_PACKAGES="libgmp-dev libzip-dev libyaml-dev libzstd-dev libargon2
1111ARG DP_PHP_CONFIGURE_OPTIONS_APPEND=""
1212ARG DP_PHP_CONFIGURE_OPTIONS="--enable-bcmath --enable-exif --enable-intl --enable-pcntl --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-gmp --with-zip --with-pic --enable-mysqlnd --with-password-argon2 --with-sodium --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-iconv --with-openssl --with-readline --with-zlib --disable-phpdbg --disable-cgi --enable-fpm --with-fpm-user=nonroot --with-fpm-group=nonroot ${DP_PHP_CONFIGURE_OPTIONS_APPEND}"
1313
14+ FROM --platform="${PLATFORM}" golang:latest AS golang
15+
16+ COPY "./dependency_resolve" "/dependency_resolve"
17+
18+ RUN apt-get update && apt-get install -y "binutils" \
19+ && cd "/dependency_resolve" \
20+ && go build -o="/usr/local/bin/dependency_resolve" . \
21+ && cd - \
22+ && strip --strip-all "/usr/local/bin/dependency_resolve" \
23+ && dependency_resolve -v
24+
1425FROM --platform="${PLATFORM}" debian:12
1526
1627ARG DP_CFLAGS_OPTIMIZE
@@ -26,7 +37,7 @@ ARG DP_PHP_CONFIGURE_OPTIONS
2637# base
2738RUN apt-get update \
2839 && apt-get install -y --no-install-recommends \
29- "build-essential" "ca-certificates" "pkg-config" "autoconf" "automake" "bison" "re2c" "curl"
40+ "build-essential" "ca-certificates" "pkg-config" "autoconf" "automake" "bison" "re2c" "curl" "binutils"
3041
3142# ICU
3243COPY "third_party/unicode-org/icu" "/build/icu"
@@ -65,5 +76,5 @@ RUN apt-get update \
6576 && make install \
6677 && cd -
6778
68- COPY --chmod=755 "dependency_resolve /dependency_resolve" "/usr/local/bin/dependency_resolve"
79+ COPY --from=golang "/usr/local/bin /dependency_resolve" "/usr/local/bin/dependency_resolve"
6980COPY --chmod=755 "distroless_php_add_binary" "/usr/local/bin/distroless_php_add_binary"
Original file line number Diff line number Diff line change @@ -20,4 +20,4 @@ for BIN in "${@}"; do
2020 esac
2121done
2222
23- dependency_resolve " /usr/bin/ldd " ${@ } | xargs -I {} sh -c ' mkdir -p /rootfs/$(dirname "{}") && cp -apP "{}" /rootfs/{}'
23+ dependency_resolve ${@ } | xargs -I {} sh -c ' mkdir -p /rootfs/$(dirname "{}") && cp -apP "{}" " /rootfs/{}" && (strip --strip-all "/rootfs/{}" || true) '
You can’t perform that action at this time.
0 commit comments