Skip to content

Commit

Permalink
Install libxcrypt
Browse files Browse the repository at this point in the history
This will make `libcrypt.so.2` available in the image. The GLIBC
variants of the header and libraries are deleted in order to force
applications to pick up the `libxcrypt` version.
  • Loading branch information
lkollar committed Jul 19, 2019
1 parent fbd4518 commit 201440b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docker/build_scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ cd ..
rm -rf $SQLITE_AUTOCONF_VERSION*
rm /usr/local/lib/libsqlite3.a

# Install libcrypt.so.2
build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"

# Compile the latest Python releases.
# (In order to have a proper SSL module, Python is compiled
# against a recent openssl [see env vars above], which is linked
Expand Down
4 changes: 4 additions & 0 deletions docker/build_scripts/build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ SQLITE_AUTOCONF_VERSION=sqlite-autoconf-3270200
SQLITE_AUTOCONF_HASH=50c39e85ea28b5ecfdb3f9e860afe9ba606381e21836b2849efca6a0bfe6ef6e
SQLITE_AUTOCONF_DOWNLOAD_URL=https://www.sqlite.org/2019

LIBXCRYPT_VERSION=4.4.6
LIBXCRYPT_DOWNLOAD_URL=https://codeload.github.com/besser82/libxcrypt/tar.gz
LIBXCRYPT_HASH=4c33b80d3e1363c218ec6132bae0ea9eae181af9f9892939e90ec44b246ebe23

GIT_ROOT=2.21.0
GIT_HASH=7a601275abcc6ff51cc79a6d402e83c90ae37d743b0b8d073aa009dd4b22d432
GIT_DOWNLOAD_URL=https://github.com/git/git/archive
Expand Down
17 changes: 16 additions & 1 deletion docker/build_scripts/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ function build_git {


function do_standard_install {
./configure > /dev/null
local configure_args=$1
./configure "$configure_args" > /dev/null
make > /dev/null
make install > /dev/null
}
Expand Down Expand Up @@ -208,3 +209,17 @@ function build_libtool {
(cd ${libtool_fname} && do_standard_install)
rm -rf ${libtool_fname} ${libtool_fname}.tar.gz
}

function build_libxcrypt {
curl -fsSLO "$LIBXCRYPT_DOWNLOAD_URL"/v"$LIBXCRYPT_VERSION"
check_sha256sum "v$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
tar xfz "v$LIBXCRYPT_VERSION"
(cd "libxcrypt-$LIBXCRYPT_VERSION" && ./bootstrap && \
do_standard_install \
--disable-obsolete-api \
--enable-hashes=all)

# Delete GLIBC version headers and libraries
rm -rf /usr/include/crypt.h
rm -rf /usr/lib64/libcrypt.a /usr/lib64/libcrypt.so
}

0 comments on commit 201440b

Please sign in to comment.