mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 12:47:28 +08:00
feat: 使用多阶段构建优化 wasm-go 构建流程 (#192)
This commit is contained in:
@@ -1,2 +1,17 @@
|
||||
FROM scratch
|
||||
COPY main.wasm plugin.wasm
|
||||
ARG BUILDER=higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/wasm-go-builder:go1.19-tinygo0.26.0
|
||||
FROM $BUILDER as builder
|
||||
|
||||
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 -target=wasi ./main.go
|
||||
|
||||
FROM scratch as output
|
||||
|
||||
COPY --from=builder /main.wasm plugin.wasm
|
||||
|
||||
Reference in New Issue
Block a user