forked from Kong/docker-kong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.rpm
43 lines (31 loc) · 1.37 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
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"]