You encountered this error during Docker build:
curl: (1) Protocol "https" not supported or disabled in libcurl
Amazon Linux 2 base images sometimes have curl compiled without HTTPS/SSL support, or the SSL libraries are missing/incompatible.
- Installed curl: Added
curlpackage (not justcurl-devel) - Added wget: Installed
wgetas a fallback downloader - Added verification: Check curl HTTPS support and reinstall if needed
Changed download pattern from:
curl -fL URL -o file.tar.gzTo:
(curl -fL URL -o file.tar.gz || wget -O file.tar.gz URL)This provides automatic fallback when curl fails.
RUN yum update -y && \
yum install -y git autoconf libtool flex bison cmake make \
tar gzip gcc gcc-c++ automake16 libpng-devel nasm \
libxml2-devel readline-devel curl curl-devel wget \
cmake3 && \
yum clean all && \
rm -rf /var/cache/yum /var/lib/yum/history /tmp/* /var/tmp/*# Verify curl has HTTPS support
RUN curl --version | grep -i https || (echo "curl HTTPS support missing, installing..." && yum reinstall -y curl)- Uses curl with
-fLflags for better error handling -f: Fail silently on HTTP errors-L: Follow redirects
- If curl fails, automatically tries wget
- wget typically has better SSL support in Amazon Linux 2
-O: Output to specified file
- Both methods retry up to 3 times with 5-second delays
- Handles temporary network issues
docker run --rm public.ecr.aws/lambda/provided:al2 curl --versiondocker run --rm public.ecr.aws/lambda/provided:al2 curl -I https://github.comdocker buildx build --platform=linux/amd64 -f dockerfiles/Dockerfile -t test-gdal .If HTTPS issues persist, consider using AL2023:
FROM public.ecr.aws/lambda/provided:al2023 AS builderFor maximum compatibility:
RUN yum install -y openssl-devel && \
curl -L https://curl.se/download/curl-8.4.0.tar.gz | tar zx && \
cd curl-8.4.0 && \
./configure --with-openssl && \
make && make installConsider using Ubuntu-based Lambda images:
FROM public.ecr.aws/lambda/python:3.12curl --version
curl-config --protocolscurl -I https://github.com
wget --spider https://github.comThe HTTPS/SSL issues should now be resolved! The dual download strategy with curl/wget fallback provides robust HTTPS support. 🚀