-
Notifications
You must be signed in to change notification settings - Fork 835
/
Dockerfile.deb
53 lines (40 loc) · 1.79 KB
/
Dockerfile.deb
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
# When you update this file substantially, please update build_your_own_images.md as well.
FROM debian:bullseye-20230502-slim
LABEL maintainer="Kong Docker Maintainers <[email protected]> (@team-gateway-bot)"
ARG KONG_VERSION=3.8.0
ENV KONG_VERSION $KONG_VERSION
ARG KONG_SHA256="eec87ce7169668b35f4985ce78e08fced37d77c8b9e49608e02f4a703c90cdf2"
ARG KONG_PREFIX=/usr/local/kong
ENV KONG_PREFIX $KONG_PREFIX
ARG ASSET=remote
ARG EE_PORTS
COPY kong.deb /tmp/kong.deb
RUN set -ex; \
apt-get update; \
apt-get install -y curl; \
if [ "$ASSET" = "remote" ] ; then \
CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d = -f 2) \
&& KONG_REPO=$(echo ${KONG_VERSION%.*} | sed 's/\.//') \
&& DOWNLOAD_URL="https://packages.konghq.com/public/gateway-$KONG_REPO/deb/debian/pool/$CODENAME/main/k/ko/kong_$KONG_VERSION/kong_${KONG_VERSION}_amd64.deb" \
&& curl -fL $DOWNLOAD_URL -o /tmp/kong.deb \
&& echo "$KONG_SHA256 /tmp/kong.deb" | sha256sum -c -; \
fi \
&& apt-get update \
&& apt-get install --yes /tmp/kong.deb \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/kong.deb \
&& 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 \
&& apt-get purge curl -y
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"]