Skip to content

Instantly share code, notes, and snippets.

@tsahara
Last active April 20, 2018 02:16
Show Gist options
  • Save tsahara/e6831656d7e2ff99ce7e to your computer and use it in GitHub Desktop.
Save tsahara/e6831656d7e2ff99ce7e to your computer and use it in GitHub Desktop.
Dockerfile for nghttp2 with ALPN support
FROM ubuntu
RUN apt-get update
RUN apt-get install -y autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libxml2-dev libjansson-dev libjemalloc-dev libev-dev
RUN apt-get install -y make gcc git g++
RUN apt-get install -y curl
#
# OpenSSL 1.0.2a
#
WORKDIR /root
RUN curl https://www.openssl.org/source/openssl-1.0.2a.tar.gz | tar xzf -
WORKDIR /root/openssl-1.0.2a
RUN ./config shared zlib-dynamic
RUN make
RUN make install_sw
RUN echo '/usr/local/ssl/lib' >/etc/ld.so.conf.d/openssl.conf
RUN ldconfig
RUN apt-get remove -y openssl
#
# nghttp2
#
WORKDIR /root
RUN git clone https://github.com/tatsuhiro-t/nghttp2.git
WORKDIR /root/nghttp2
RUN autoreconf -i
RUN automake
RUN autoconf
RUN env OPENSSL_CFLAGS="-I/usr/local/ssl/include" OPENSSL_LIBS="-L/usr/local/ssl/lib -lssl -lcrypto" ./configure
RUN make
RUN /usr/local/ssl/bin/openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -out server.key
RUN /usr/local/ssl/bin/openssl req -new -x509 -key server.key -out server.crt -subj /CN="nghttp2"
EXPOSE 443
CMD ["./src/nghttpd", "-v", "443", "server.key", "server.crt"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment