Skip to content

Instantly share code, notes, and snippets.

@lamielle
Created July 28, 2017 21:15
Show Gist options
  • Save lamielle/911333a7ab76d40895a63744de79ec49 to your computer and use it in GitHub Desktop.
Save lamielle/911333a7ab76d40895a63744de79ec49 to your computer and use it in GitHub Desktop.
Kong 0.11.0rc2 Dockerfile, non-optimized
FROM fedora:25
MAINTAINER Marco Palladino, marco@mashape.com
ENV KONG_VERSION 0.11.0rc2
RUN dnf clean metadata && dnf -v -y -4 --setopt=deltarpm=false install readline-devel pcre-devel openssl openssl-devel gcc curl perl unzip git wget make findutils which
RUN mkdir /openresty && cd /openresty && wget https://openresty.org/download/openresty-1.11.2.4.tar.gz && tar -xvf openresty-1.11.2.4.tar.gz
RUN cd /openresty/openresty-1.11.2.4 && ./configure \
--prefix=/usr/local/openresty \
--with-pcre-jit \
--with-ipv6 \
--with-http_realip_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--without-luajit-lua52
RUN cd /openresty/openresty-1.11.2.4 && gmake && gmake install
RUN mkdir /luarocks && cd /luarocks && wget http://luarocks.github.io/luarocks/releases/luarocks-2.4.2.tar.gz && tar -xvf luarocks-2.4.2.tar.gz
RUN cd /luarocks/luarocks-2.4.2/ && ./configure \
--lua-suffix=jit \
--with-lua=/usr/local/openresty/luajit \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
RUN cd /luarocks/luarocks-2.4.2 && make build && make install
RUN mkdir /kong && cd /kong && wget https://github.com/Mashape/kong/archive/0.11.0rc2.tar.gz && tar -xvf 0.11.0rc2.tar.gz
RUN cd /kong/kong-0.11.0rc2 && luarocks install OPENSSL_DIR=/usr kong-0.11.0rc2-0.rockspec
RUN dnf -v -y -4 --setopt=deltarpm=false install perl-Time-HiRes
RUN cp /kong/kong-0.11.0rc2/bin/kong /usr/local/bin/ && ln -s /usr/local/openresty/bin/resty /usr/local/bin/resty
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 && \
chmod +x /usr/local/bin/dumb-init
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 8000 8443 8001
CMD ["kong", "start"]
@lamielle
Copy link
Author

Due to the lack of an RPM/DEB for the RC2 release of Kong 0.11.0, I took some time to build out this (very hacky and non-optimized) Dockerfile. Building this locally and running locally allows me to test out the new regexp functionality that was just merged in RC2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment