Skip to content

Instantly share code, notes, and snippets.

@JeffIrwin
Created May 21, 2025 00:46
Show Gist options
  • Select an option

  • Save JeffIrwin/eb59dca6020b402a48cc327683e59323 to your computer and use it in GitHub Desktop.

Select an option

Save JeffIrwin/eb59dca6020b402a48cc327683e59323 to your computer and use it in GitHub Desktop.
Build curl from source on rocky linux 8 in docker
FROM rockylinux:8
#FROM rockylinux:9
WORKDIR /workdir
RUN yum update -y && \
yum install -y \
autoconf \
automake \
cmake \
curl \
gcc \
gettext-autopoint \
git \
libtool \
openssl-devel \
pkgconf \
python2 \
which
#========================================
# Build libpsl
WORKDIR /workdir/
## Just get the tarball instead of bothering with autotools
#RUN curl -LO https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz
#RUN tar xvf libpsl-*.tar.gz -C .
#RUN mv libpsl-*/ libpsl
RUN git clone https://github.com/rockdaboot/libpsl
WORKDIR /workdir/libpsl
# Build a relocatable libpsl lib that curl can link to
ENV CFLAGS="-fPIC"
RUN ./autogen.sh
RUN ./configure
RUN make
RUN make check
#========================================
# Build curl
WORKDIR /workdir/
RUN git clone https://github.com/curl/curl
WORKDIR /workdir/curl
RUN cmake . \
-DLIBPSL_INCLUDE_DIR=/workdir/libpsl/include/ \
-DLIBPSL_LIBRARY=/workdir/libpsl/src/.libs/libpsl.a
RUN make
RUN ls -ltrh ./lib/libcurl.so*
RUN ./src/curl --version
#========================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment