Align OCI build with the OSS docker-library repo

This commit is contained in:
Rin Kuryloski 2023-06-14 12:36:39 +02:00
parent d4ea19e9b2
commit ad2f85bb75
2 changed files with 8 additions and 7 deletions

View File

@ -6,6 +6,7 @@ OPENSSL_PATH="/usr/local/src/openssl-$OPENSSL_VERSION"
OPENSSL_CONFIG_DIR=/usr/local/etc/ssl
cd "$OPENSSL_PATH"
debMultiarch="$(dpkg-architecture --query DEB_HOST_MULTIARCH)"
# OpenSSL's "config" script uses a lot of "uname"-based target detection...
MACHINE="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)" \
RELEASE="4.x.y-z" \
@ -13,17 +14,17 @@ SYSTEM='Linux' \
BUILD='???' \
./config \
--openssldir="$OPENSSL_CONFIG_DIR" \
-Wl,-rpath=/usr/local/lib # add -rpath to avoid conflicts between our OpenSSL's "libssl.so" and the libssl package by making sure /usr/local/lib is searched first (but only for Erlang/OpenSSL to avoid issues with other tools using libssl; https://github.com/docker-library/rabbitmq/issues/364)
--libdir="lib/$debMultiarch" \
-Wl,-rpath="/usr/local/lib/$debMultiarch" # add -rpath to avoid conflicts between our OpenSSL's "libssl.so" and the libssl package by making sure /usr/local/lib is searched first (but only for Erlang/OpenSSL to avoid issues with other tools using libssl; https://github.com/docker-library/rabbitmq/issues/364)
# Compile, install OpenSSL, verify that the command-line works & development headers are present
make -j "$(getconf _NPROCESSORS_ONLN)"
make install
cd ..
rm -rf "$OPENSSL_PATH"*
echo "/usr/local/lib64" > /etc/ld.so.conf.d/openssl-$OPENSSL_VERSION.conf
ldconfig -v
make install_sw install_ssldirs
ldconfig
# use Debian's CA certificates
rmdir "$OPENSSL_CONFIG_DIR/certs" "$OPENSSL_CONFIG_DIR/private"
ln -sf /etc/ssl/certs /etc/ssl/private "$OPENSSL_CONFIG_DIR"
# cleanup sources
rm -rf "$OPENSSL_PATH"*
# smoke test
openssl version -a

View File

@ -12,7 +12,7 @@ export ERL_TOP="$OTP_PATH"
./otp_build autoconf
CFLAGS="$(dpkg-buildflags --get CFLAGS)"; export CFLAGS
# add -rpath to avoid conflicts between our OpenSSL's "libssl.so" and the libssl package by making sure /usr/local/lib is searched first (but only for Erlang/OpenSSL to avoid issues with other tools using libssl; https://github.com/docker-library/rabbitmq/issues/364)
export CFLAGS="$CFLAGS -Wl,-rpath=/usr/local/lib"
export CFLAGS="$CFLAGS -Wl,-rpath=/usr/local/lib/$(dpkg-architecture --query DEB_HOST_MULTIARCH)"
hostArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)"
buildArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
dpkgArch="$(dpkg --print-architecture)"; dpkgArch="${dpkgArch##*-}"