mirror of
https://github.com/alibaba/higress.git
synced 2026-02-21 22:40:59 +08:00
25 lines
539 B
Docker
25 lines
539 B
Docker
ARG BUILDER=higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/wasm-go-builder:go1.20.14-tinygo0.29.0-oras1.0.0
|
|
FROM $BUILDER as builder
|
|
|
|
|
|
ARG GOPROXY
|
|
ENV GOPROXY=${GOPROXY}
|
|
|
|
ARG EXTRA_TAGS=""
|
|
ENV EXTRA_TAGS=${EXTRA_TAGS}
|
|
|
|
ARG PLUGIN_NAME=hello-world
|
|
|
|
WORKDIR /workspace
|
|
|
|
COPY . .
|
|
|
|
WORKDIR /workspace/extensions/$PLUGIN_NAME
|
|
|
|
RUN go mod tidy
|
|
RUN tinygo build -o /main.wasm -scheduler=none -gc=custom -tags="custommalloc nottinygc_finalizer $EXTRA_TAGS" -target=wasi ./
|
|
|
|
FROM scratch as output
|
|
|
|
COPY --from=builder /main.wasm plugin.wasm
|