-
Notifications
You must be signed in to change notification settings - Fork 838
/
Dockerfile
53 lines (41 loc) · 1.57 KB
/
Dockerfile
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
FROM alpine:3.11
LABEL maintainer="Kong <support@konghq.com>"
ARG ASSET=ce
ENV ASSET $ASSET
ARG EE_PORTS
COPY kong.tar.gz /tmp/kong.tar.gz
ARG KONG_VERSION=2.2.0
ENV KONG_VERSION $KONG_VERSION
RUN set -eux; \
arch="$(apk --print-arch)"; \
case "${arch}" in \
x86_64) arch='amd64'; KONG_SHA256='6adb706eab6cc535f2703bd8993a5d5259159cf8a630c3d3974973dbe6bbf5a6' ;; \
aarch64) arch='arm64'; KONG_SHA256='a93b1c015d86b5d8b4038f3fd73332bfef97fa1c768545f353af03f54cf97fb8' ;; \
esac; \
if [ "$ASSET" = "ce" ] ; then \
apk add --no-cache --virtual .build-deps curl wget tar ca-certificates && \
curl -fL "https://bintray.com/kong/kong-alpine-tar/download_file?file_path=kong-$KONG_VERSION.$arch.apk.tar.gz" -o /tmp/kong.tar.gz && \
echo "$KONG_SHA256 /tmp/kong.tar.gz" | sha256sum -c -; \
apk del .build-deps; \
fi; \
mkdir /kong; \
tar -C /kong -xzf /tmp/kong.tar.gz && \
mv /kong/usr/local/* /usr/local && \
mv /kong/etc/* /etc && \
rm -rf /kong && \
apk add --no-cache libstdc++ libgcc openssl pcre perl tzdata libcap zip bash zlib zlib-dev git ca-certificates && \
adduser -S kong && \
mkdir -p "/usr/local/kong" && \
chown -R kong:0 /usr/local/kong && \
chown kong:0 /usr/local/bin/kong && \
chmod -R g=u /usr/local/kong && \
rm -rf /tmp/kong.tar.gz && \
if [ "$ASSET" = "ce" ] ; then \
kong version ; \
fi;
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER kong
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 8000 8443 8001 8444 $EE_PORTS
STOPSIGNAL SIGQUIT
CMD ["kong", "docker-start"]