forked from Kong/docker-kong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.apk
58 lines (44 loc) · 1.98 KB
/
Dockerfile.apk
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
# When you update this file substantially, please update build_your_own_images.md as well.
FROM alpine:3.17
LABEL maintainer="Kong Docker Maintainers <[email protected]> (@team-gateway-bot)"
ARG KONG_VERSION=3.1.1
ENV KONG_VERSION $KONG_VERSION
ARG KONG_AMD64_SHA="9194977814e91b6997ce4795957d9b4bcec9d220667e01a08ade7ac64704f57c"
ARG KONG_ARM64_SHA="92d98307a3193602bbe4dbed2d099cde5404a8acd09d53f0b9a9f2bcf6038500"
ARG KONG_PREFIX=/usr/local/kong
ENV KONG_PREFIX $KONG_PREFIX
ARG ASSET=remote
ARG EE_PORTS
COPY kong.apk.tar.gz /tmp/kong.apk.tar.gz
RUN set -ex; \
apk add curl tar gzip ca-certificates; \
arch="$(apk --print-arch)"; \
case "${arch}" in \
x86_64) export ARCH='amd64'; KONG_SHA256=$KONG_AMD64_SHA ;; \
aarch64) export ARCH='arm64'; KONG_SHA256=$KONG_ARM64_SHA ;; \
esac; \
if [ "$ASSET" = "remote" ] ; then \
curl -fL "https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-alpine/kong-${KONG_VERSION}.${ARCH}.apk.tar.gz" -o /tmp/kong.apk.tar.gz \
&& echo "$KONG_SHA256 /tmp/kong.apk.tar.gz" | sha256sum -c -; \
fi \
&& tar -C / -xzf /tmp/kong.apk.tar.gz \
&& apk add --no-cache libstdc++ libgcc perl tzdata libcap zlib zlib-dev bash \
&& adduser -S kong \
&& addgroup -S kong \
&& mkdir -p "${KONG_PREFIX}" \
&& chown -R kong:0 ${KONG_PREFIX} \
&& chown kong:0 /usr/local/bin/kong \
&& chmod -R g=u ${KONG_PREFIX} \
&& rm -rf /tmp/kong.apk.tar.gz \
&& 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=60s --timeout=10s --retries=10 CMD kong-health
CMD ["kong", "docker-start"]