Skip to content

Instantly share code, notes, and snippets.

@kipras
Last active January 23, 2019 13:13
Show Gist options
  • Save kipras/82092c97cd7d7104d3281d2c956a78e7 to your computer and use it in GitHub Desktop.
Save kipras/82092c97cd7d7104d3281d2c956a78e7 to your computer and use it in GitHub Desktop.
curl-7.61.0 GnuTLS-3.6.3+ (2018 08 22) nghttp2-1.32.0
# This is a Dockerfile for building a Docker image containing a recent `curl`, with HTTP/2 and
# TLSv1.3 support. The exact versions of `curl` and it's dependencies that are used are:
# curl-7.61.0
# GnuTLS-3.6.3+ (2018 08 22)
# nghttp2-1.32.0
#
# Building
# 1. download `curl.Dockerfile`
# 2. run
# docker build -t curl -t curl:7.61.0 -f curl.Dockerfile .
#
# Running
# Once the image is built - you can use it to run the built `curl` as a command, by simply adding a
# `docker run --rm` prefix, like this:
# docker run --rm curl [curl_options]
#
# e.g.:
# docker run --rm curl https://www.google.com/
FROM ubuntu:bionic
WORKDIR /root
RUN apt-get update && apt-get install -y wget bzip2 make perl gcc pkg-config zlib1g-dev
# download and compile GnuTLS
RUN apt-get update && apt-get install -y dash git-core autoconf libtool gettext autopoint automake autogen nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.0-dev libtasn1-6-dev libidn2-0-dev gawk gperf libunbound-dev dns-root-data bison help2man gtk-doc-tools texinfo texlive texlive-generic-recommended texlive-extra-utils
RUN git clone https://gitlab.com/gnutls/gnutls
RUN mv gnutls gnutls-master-2018_08_22_eedcaa69
RUN cd gnutls-master-2018_08_22_eedcaa69 && git checkout eedcaa695277653230ede9adb703dac97cdea7e1 && git submodule update --init --recursive
RUN cd gnutls-master-2018_08_22_eedcaa69 && ./bootstrap
RUN cd gnutls-master-2018_08_22_eedcaa69 && ./configure
RUN cd gnutls-master-2018_08_22_eedcaa69 && make -j8
RUN cd gnutls-master-2018_08_22_eedcaa69 && make install
RUN ldconfig
# download and compile nghttp2
RUN wget https://github.com/nghttp2/nghttp2/releases/download/v1.32.0/nghttp2-1.32.0.tar.bz2
RUN tar -xvf nghttp2-1.32.0.tar.bz2
RUN cd nghttp2-1.32.0 && ./configure
RUN cd nghttp2-1.32.0 && make -j8
RUN cd nghttp2-1.32.0 && make install
RUN ldconfig
# download and compile curl
RUN wget https://curl.haxx.se/download/curl-7.61.0.tar.bz2
RUN tar -xvf curl-7.61.0.tar.bz2
RUN cd curl-7.61.0 && ./configure --with-nghttp2 --without-ssl --with-gnutls=/root/gnutls-master-2018_08_22_eedcaa69
RUN cd curl-7.61.0 && make -j8
RUN cd curl-7.61.0 && make install
RUN ldconfig
# cleanup (so the image takes less space)
RUN rm -rf gnutls-*
RUN rm -rf nghttp2-*
RUN rm -rf curl-*
RUN apt-get purge -y wget bzip2 make perl gcc pkg-config zlib1g-dev
RUN apt-get purge -y git-core autoconf libtool gettext autopoint automake autogen nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.0-dev libtasn1-6-dev libidn2-0-dev gawk gperf libunbound-dev dns-root-data bison help2man gtk-doc-tools texinfo texlive texlive-generic-recommended texlive-extra-utils
RUN apt-get autoremove -y
RUN apt-get clean && apt-get autoclean
RUN rm -rf /var/cache/apt
ENTRYPOINT ["curl"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment