mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
feat: Use new wasm-go-builder with oras in the Makefile (#308)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
ARG BUILDER=higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/wasm-go-builder:go1.19-tinygo0.27.0
|
ARG BUILDER=higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/wasm-go-builder:go1.19-tinygo0.27.0-oras1.0.0
|
||||||
FROM $BUILDER as builder
|
FROM $BUILDER as builder
|
||||||
|
|
||||||
ARG PLUGIN_NAME=hello-world
|
ARG PLUGIN_NAME=hello-world
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ PLUGIN_NAME ?= hello-world
|
|||||||
REGISTRY ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/
|
REGISTRY ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/
|
||||||
GO_VERSION ?= 1.19
|
GO_VERSION ?= 1.19
|
||||||
TINYGO_VERSION ?= 0.27.0
|
TINYGO_VERSION ?= 0.27.0
|
||||||
BUILDER ?= ${REGISTRY}wasm-go-builder:go${GO_VERSION}-tinygo${TINYGO_VERSION}
|
ORAS_VERSION ?= 1.0.0
|
||||||
|
BUILDER ?= ${REGISTRY}wasm-go-builder:go${GO_VERSION}-tinygo${TINYGO_VERSION}-oras${ORAS_VERSION}
|
||||||
BUILD_TIME := $(shell date "+%Y%m%d-%H%M%S")
|
BUILD_TIME := $(shell date "+%Y%m%d-%H%M%S")
|
||||||
COMMIT_ID := $(shell git rev-parse --short HEAD 2>/dev/null)
|
COMMIT_ID := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||||
IMG ?= ${REGISTRY}${PLUGIN_NAME}:${BUILD_TIME}-${COMMIT_ID}
|
IMG ?= ${REGISTRY}${PLUGIN_NAME}:${BUILD_TIME}-${COMMIT_ID}
|
||||||
@@ -25,17 +26,17 @@ build-push: build
|
|||||||
# To build a wasm-go-builder image.
|
# To build a wasm-go-builder image.
|
||||||
# e.g.
|
# e.g.
|
||||||
# REGISTRY=<your_docker_registry> make builder
|
# REGISTRY=<your_docker_registry> make builder
|
||||||
# If you want to use Go/TinyGo with another version, please modify GO_VERSION/TINYGO_VERSION.
|
# If you want to use Go/TinyGo/Oras with another version, please modify GO_VERSION/TINYGO_VERSION/ORAS_VERSION.
|
||||||
# After your wasm-go-builder image is built, you can use it to build plugin image.
|
# After your wasm-go-builder image is built, you can use it to build plugin image.
|
||||||
# e.g.
|
# e.g.
|
||||||
# PLUGIN_NAME=request-block BUILDER=<your-wasm-go-builder> make
|
# PLUGIN_NAME=request-block BUILDER=<your-wasm-go-builder> make
|
||||||
builder:
|
builder:
|
||||||
BUILDER=$(REGISTRY)wasm-go-builder:go$(GO_VERSION)-tinygo$(TINYGO_VERSION)
|
|
||||||
docker buildx build --no-cache \
|
docker buildx build --no-cache \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--build-arg BASE_IMAGE=docker.io/ubuntu \
|
--build-arg BASE_IMAGE=docker.io/ubuntu \
|
||||||
--build-arg GO_VERSION=$(GO_VERSION) \
|
--build-arg GO_VERSION=$(GO_VERSION) \
|
||||||
--build-arg TINYGO_VERSION=$(TINYGO_VERSION) \
|
--build-arg TINYGO_VERSION=$(TINYGO_VERSION) \
|
||||||
|
--build-arg ORAS_VERSION=$(ORAS_VERSION) \
|
||||||
-f DockerfileBuilder \
|
-f DockerfileBuilder \
|
||||||
-t ${BUILDER} \
|
-t ${BUILDER} \
|
||||||
--push \
|
--push \
|
||||||
|
|||||||
Reference in New Issue
Block a user