44 lines
1.4 KiB
Docker
44 lines
1.4 KiB
Docker
FROM redhat/ubi8
|
|
|
|
ARG KONG_VERSION=2.8.1
|
|
ENV KONG_VERSION $KONG_VERSION
|
|
|
|
ARG KONG_SHA256="8bae61982b8d439e12037e24432adc185f87113989c27c89521d8cc024b38ddc"
|
|
|
|
ARG ASSET=remote
|
|
ARG EE_PORTS
|
|
|
|
COPY kong.rpm /tmp/kong.rpm
|
|
|
|
# hadolint ignore=DL3015
|
|
RUN set -ex; \
|
|
if [ "$ASSET" = "remote" ] ; then \
|
|
VERSION=$(grep '^VERSION_ID' /etc/os-release | cut -d = -f 2 | sed -e 's/^"//' -e 's/"$//' | cut -d . -f 1) \
|
|
&& DOWNLOAD_URL="https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-rhel-$VERSION/Packages/k/kong-$KONG_VERSION.rhel$VERSION.amd64.rpm" \
|
|
&& curl -fL $DOWNLOAD_URL -o /tmp/kong.rpm \
|
|
&& echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -; \
|
|
fi \
|
|
&& yum install -y /tmp/kong.rpm \
|
|
&& rm /tmp/kong.rpm \
|
|
&& chown kong:0 /usr/local/bin/kong \
|
|
&& chown -R kong:0 /usr/local/kong \
|
|
&& ln -s /usr/local/openresty/bin/resty /usr/local/bin/resty \
|
|
&& ln -s /usr/local/openresty/luajit/bin/luajit /usr/local/bin/luajit \
|
|
&& ln -s /usr/local/openresty/luajit/bin/luajit /usr/local/bin/lua \
|
|
&& ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx \
|
|
&& kong version
|
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
USER kong
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
EXPOSE 8000 8443 8001 8444 $EE_PORTS
|
|
|
|
STOPSIGNAL SIGQUIT
|
|
|
|
HEALTHCHECK --interval=10s --timeout=10s --retries=10 CMD kong health
|
|
|
|
CMD ["kong", "docker-start"]
|