代码拉取完成,页面将自动刷新
FROM golang:alpine as builder
# 更换alpine下载镜像
RUN sed -i 's!http://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /etc/apk/repositories
RUN apk add --no-cache git gcc libc-dev curl
RUN mkdir /go-plugins
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go env -w GOSUMDB=sum.golang.google.cn
RUN go env -w GO111MODULE=on
COPY ./go-hello.go /go-plugins/go-hello.go
RUN cd /go-plugins && go mod init kong-go-plugin && go get github.com/Kong/go-pdk && go mod tidy && go build go-hello.go
#####################
## Release image
#####################
FROM kong:2.7.0-alpine
# Copy Go files
COPY --from=builder /go-plugins/go-hello /usr/local/bin/
ENV KONG_PLUGINS=bundled,go-hello
ENV KONG_PLUGINSERVER_NAMES=go-hello
ENV KONG_PLUGINSERVER_GO_HELLO_QUERY_CMD="go-hello -dump"
USER kong
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。