You encountered this error during Docker build:
configure: error: library 'crypto' is required for OpenSSL
The error occurs when:
- OpenSSL development libraries are not properly installed
- OpenSSL libraries are not found in the expected locations
- Package conflicts prevent proper OpenSSL installation
- Missing pkg-config configuration for OpenSSL
# Install OpenSSL development libraries with proper conflict resolution
RUN yum install -y openssl openssl-devel || \
(yum remove -y openssl-snapsafe-libs 2>/dev/null || true) && \
yum install -y openssl openssl-devel# Verify OpenSSL installation
RUN openssl version && \
ls -la /usr/lib64/libssl.so* /usr/lib64/libcrypto.so* && \
pkg-config --exists openssl && echo "OpenSSL pkg-config OK" || echo "OpenSSL pkg-config missing"Added OpenSSL environment variables for proper linking:
ENV OPENSSL_ROOT_DIR=/usr
ENV OPENSSL_LIBRARIES=/usr/lib64
ENV OPENSSL_INCLUDE_DIR=/usr/include/openssl
ENV PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$PKG_CONFIG_PATHEnhanced PostgreSQL build with explicit OpenSSL linking:
&& LDFLAGS="-L/usr/lib64" CPPFLAGS="-I/usr/include/openssl" make -j $(nproc) --silent && make install- Primary: Install both
opensslandopenssl-develpackages - Fallback: Remove conflicting
openssl-snapsafe-libsif needed - Retry: Reinstall OpenSSL packages after conflict resolution
- Version Check:
openssl versionconfirms OpenSSL is installed - Library Check: Lists OpenSSL shared libraries
- Pkg-config Check: Verifies pkg-config can find OpenSSL
- OPENSSL_ROOT_DIR: Points to OpenSSL installation root
- OPENSSL_LIBRARIES: Points to OpenSSL library directory
- OPENSSL_INCLUDE_DIR: Points to OpenSSL header directory
- PKG_CONFIG_PATH: Includes OpenSSL pkg-config directory
docker run --rm public.ecr.aws/lambda/provided:al2 openssl versiondocker run --rm public.ecr.aws/lambda/provided:al2 ls -la /usr/lib64/libssl.so* /usr/lib64/libcrypto.so*docker buildx build --platform=linux/amd64 -f dockerfiles/Dockerfile -t test-gdal .If OpenSSL issues persist, consider using Amazon Linux 2023:
FROM public.ecr.aws/lambda/provided:al2023 AS builderFor maximum compatibility:
RUN curl -L https://www.openssl.org/source/openssl-1.1.1w.tar.gz | tar zx && \
cd openssl-1.1.1w && \
./config --prefix=/usr/local/openssl && \
make && make installEnsure system OpenSSL is properly configured:
RUN yum install -y openssl11 openssl11-devel && \
ln -sf /usr/lib64/openssl11 /usr/lib64/opensslopenssl version
pkg-config --modversion opensslldconfig -p | grep ssl
find /usr -name "libssl.so*" -o -name "libcrypto.so*"gcc -lssl -lcrypto -o test test.cThe OpenSSL library issues should now be resolved! The enhanced installation and environment configuration should provide proper OpenSSL support for all dependencies. 🚀