-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.alpine
37 lines (29 loc) · 1.21 KB
/
Dockerfile.alpine
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
FROM kong/go-plugin-tool:latest-alpine-latest AS builder
ENV GOPROXY https://goproxy.cn,direct
RUN mkdir -p /tmp/go/src/rate-limiting/
COPY . /tmp/go/src/rate-limiting
RUN cd /tmp/go/src/rate-limiting && \
go build -buildmode plugin custom-rate-limiting.go && \
cd /tmp/go/src/rate-limiting/go-pluginserver && \
go build github.com/Kong/go-pluginserver
FROM kong:2.1.3-alpine
ENV KONG_DATABASE off
ENV KONG_GO_PLUGINS_DIR /etc/kong/plugins/
#ENV KONG_DECLARATIVE_CONFIG /etc/kong/kong.conf
ENV KONG_PLUGINS bundled,custom-rate-limiting
ENV KONG_PROXY_ACCESS_LOG=/dev/stdout
ENV KONG_ADMIN_ACCESS_LOG=/dev/stdout
ENV KONG_PROXY_ERROR_LOG=/dev/stderr
ENV KONG_ADMIN_ERROR_LOG=/dev/stderr
ENV KONG_ADMIN_LISTEN="0.0.0.0:8001, 0.0.0.0:8444 ssl"
ENV KONG_NGINX_USER="root root"
ENV KONG_PROXY_LISTEN 0.0.0.0:8000
ENV KONG_LOG_LEVEL debug
USER root
RUN mkdir -p /etc/kong/plugins
COPY --from=builder /tmp/go/src/rate-limiting/go-pluginserver/go-pluginserver /usr/local/bin
COPY --from=builder /tmp/go/src/rate-limiting/custom-rate-limiting.so /etc/kong/plugins
# for debug
RUN /usr/local/bin/go-pluginserver -version && \
cd /etc/kong/plugins && \
/usr/local/bin/go-pluginserver -dump-plugin-info custom-rate-limiting