-
Notifications
You must be signed in to change notification settings - Fork 834
/
Dockerfile.rpm
74 lines (58 loc) · 2.5 KB
/
Dockerfile.rpm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# When you update this file substantially, please update build_your_own_images.md as well.
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7@sha256:6910799b75ad41f00891978575a0d955be2f800c51b955af73926e7ab59a41c3
LABEL maintainer="Kong Docker Maintainers <[email protected]> (@team-gateway-bot)"
ARG KONG_VERSION=3.8.0
ENV KONG_VERSION $KONG_VERSION
# RedHat required labels
LABEL name="Kong" \
vendor="Kong" \
version="$KONG_VERSION" \
release="1" \
url="https://konghq.com" \
summary="Next-Generation API Platform for Modern Architectures" \
description="Next-Generation API Platform for Modern Architectures"
# RedHat required LICENSE file approved path
COPY LICENSE /licenses/
ARG KONG_SHA256="fceec77ca7799d130145b8df35ed5c50038c8723b3f07199777dd3694049967b"
ARG KONG_PREFIX=/usr/local/kong
ENV KONG_PREFIX $KONG_PREFIX
ARG ASSET=remote
ARG EE_PORTS
COPY kong.rpm /tmp/kong.rpm
# hadolint ignore=DL3015
RUN set -ex; \
if [ "$ASSET" = "remote" ] ; then \
KONG_REPO=$(echo ${KONG_VERSION%.*} | sed 's/\.//') \
&& DOWNLOAD_URL="https://packages.konghq.com/public/gateway-$KONG_REPO/rpm/el/8/x86_64/kong-$KONG_VERSION.el8.x86_64.rpm" \
&& curl -fL $DOWNLOAD_URL -o /tmp/kong.rpm \
&& echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c - \
|| exit 1; \
fi \
# findutils provides xargs (temporarily)
&& microdnf install --assumeyes --nodocs \
findutils \
shadow-utils \
unzip \
&& rpm -qpR /tmp/kong.rpm \
| grep -v rpmlib \
| xargs -n1 -t microdnf install --assumeyes --nodocs \
# Please update the rhel install docs if the below line is changed so that
# end users can properly install Kong along with its required dependencies
# and that our CI does not diverge from our docs.
&& rpm -iv /tmp/kong.rpm \
&& microdnf -y clean all \
&& rm /tmp/kong.rpm \
&& chown kong:0 /usr/local/bin/kong \
&& chown -R kong:0 ${KONG_PREFIX} \
&& ln -sf /usr/local/openresty/bin/resty /usr/local/bin/resty \
&& ln -sf /usr/local/openresty/luajit/bin/luajit /usr/local/bin/luajit \
&& ln -sf /usr/local/openresty/luajit/bin/luajit /usr/local/bin/lua \
&& ln -sf /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=60s --timeout=10s --retries=10 CMD kong-health
CMD ["kong", "docker-start"]